-
-
Notifications
You must be signed in to change notification settings - Fork 35
fix: replace deprecated ephemeral option with MessageFlags.Ephemeral #203
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
Conversation
- Fixed deprecation warning for ephemeral interaction responses - Replaced ephemeral: true with flags: MessageFlags.Ephemeral - Replaced CommandInteraction with ChatInputCommandInteraction for proper typing - Removed unnecessary ephemeral: false (default value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request modernizes the Discord.js implementation by replacing deprecated ephemeral options with the newer MessageFlags.Ephemeral flag, aligning with Discord.js v14+ best practices. The PR also improves type safety by replacing generic CommandInteraction types with more specific ChatInputCommandInteraction types.
Key Changes:
- Replaced deprecated
ephemeral: truewithflags: MessageFlags.Ephemeralacross 6 files - Updated type annotations from
CommandInteractiontoChatInputCommandInteractionin 4 autocomplete functions - Removed unnecessary default
ephemeral: falseoption
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/structures/PageQueue.ts | Updated buttonPage method to use MessageFlags.Ephemeral |
| src/structures/CommandHandler.ts | Removed redundant ephemeral: false default parameter |
| src/services/ReplyInteractionService.ts | Removed redundant ephemeral: false and added defensive semicolon |
| src/events/track/trackStart.ts | Updated two message.reply calls to use MessageFlags.Ephemeral |
| src/events/guild/messageCreate.ts | Reformatted regex declaration for better readability |
| src/commands/Playlist/Editor.ts | Updated type from CommandInteraction to ChatInputCommandInteraction |
| src/commands/Playlist/Add.ts | Updated autocomplete function to use ChatInputCommandInteraction |
| src/commands/Music/Radio.ts | Updated message.reply to use MessageFlags.Ephemeral |
| src/commands/Music/Play.ts | Updated autocomplete function to use ChatInputCommandInteraction |
| src/commands/Music/Insert.ts | Updated autocomplete function to use ChatInputCommandInteraction |
| src/buttons/Shuffle.ts | Updated message.reply to use MessageFlags.Ephemeral |
| src/buttons/Queue.ts | Updated message.reply to use MessageFlags.Ephemeral |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| const value = (interaction.options as CommandInteractionOptionResolver).getString('id') | ||
| const value = (interaction as ChatInputCommandInteraction).options.getString('id') |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type cast on this line is redundant since the interaction parameter is already typed as ChatInputCommandInteraction in the function signature. You can simplify this to: const value = interaction.options.getString('id')
| const value = (interaction as ChatInputCommandInteraction).options.getString('id') | |
| const value = interaction.options.getString('id') |
|
|
||
| setTimeout(() => { | ||
| (!setup || setup == null || setup.channel !== this.message.channelId) && msg | ||
| ;(!setup || setup == null || setup.channel !== this.message.channelId) && msg |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable 'setup' cannot be of type null, but it is compared to an expression of type null.
| ;(!setup || setup == null || setup.channel !== this.message.channelId) && msg | |
| ;(!setup || setup.channel !== this.message.channelId) && msg |
Changes
ephemeral: truewithflags: MessageFlags.EphemeralCommandInteractionwithChatInputCommandInteractionfor proper typingephemeral: false(default value)Files Changed
Testing