-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(discord.js): make FileUploadModalData.attachments optional #11364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(discord.js): make FileUploadModalData.attachments optional #11364
Conversation
The `attachments` property in `FileUploadModalData` can be undefined when the resolved data doesn't include attachments, but the TypeScript typings previously marked it as required. This change: - Makes `attachments` optional in `FileUploadModalData` interface - Adds a type test to verify the fix This aligns with the JSDoc documentation in ModalSubmitInteraction.js which already marks `attachments` as optional (`[attachments]`). Fixes discordjs#11359
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)packages/discord.js/typings/index.test-d.ts (2)
packages/discord.js/typings/index.d.ts (1)
🔇 Additional comments (3)
Comment |
|
Duplicate of #11363 |
Summary
attachmentsproperty optional inFileUploadModalDatainterfaceIssue
Fixes #11359
Test Plan
typings/index.test-d.tsto verifyattachmentscan be undefinedpnpm run test --filter=discord.js)Changes
packages/discord.js/typings/index.d.ts: Changedattachmentsfrom required to optional inFileUploadModalDatapackages/discord.js/typings/index.test-d.ts: Added type assertion test for optional attachments