fix(discord.js): make FileUploadModalData.attachments optional#11364
fix(discord.js): make FileUploadModalData.attachments optional#11364majiayu000 wants to merge 1 commit intodiscordjs:mainfrom
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