✨feat: unify ephemeral dialog responses with in perms files#2327
✨feat: unify ephemeral dialog responses with in perms files#2327
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the boost permission dialog button handlers to respond by updating (and effectively closing) the original ephemeral dialog message, instead of sending a new ephemeral message response.
Changes:
- Introduced a small
respondAndClosehelper in each permission handler to standardize interaction responses. - Switched button interaction responses from
InteractionResponseChannelMessageWithSourcetoInteractionResponseUpdateMessage, while clearing components to disable the dialog buttons.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/boost/leaderboard_permission.go |
Unifies leaderboard permission button responses by updating the existing ephemeral dialog message and removing components. |
src/boost/coop_status_permission.go |
Unifies coop status permission button responses similarly, updating the existing dialog message and clearing components. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Type: discordgo.InteractionResponseUpdateMessage, | ||
| Data: &discordgo.InteractionResponseData{ | ||
| Content: content, | ||
| Flags: discordgo.MessageFlagsEphemeral, |
There was a problem hiding this comment.
InteractionResponseUpdateMessage responses generally cannot set Flags (ephemeral is only meaningful on the initial message creation). Including Flags: MessageFlagsEphemeral here may be ignored or can cause Discord to reject the interaction with an "Invalid Form Body" error. Suggestion: remove Flags from the update response data (the message will remain ephemeral since the original dialog message was ephemeral), and only clear Components + update Content.
| Flags: discordgo.MessageFlagsEphemeral, |
| Type: discordgo.InteractionResponseUpdateMessage, | ||
| Data: &discordgo.InteractionResponseData{ | ||
| Content: content, | ||
| Flags: discordgo.MessageFlagsEphemeral, |
There was a problem hiding this comment.
Same issue as above: InteractionResponseUpdateMessage updates should not include Flags. Setting MessageFlagsEphemeral in an update callback can be rejected by Discord or silently ignored. Suggestion: omit Flags from the update response, while still setting Content and clearing Components.
| Flags: discordgo.MessageFlagsEphemeral, |
No description provided.