edit if deferred or replied
This commit is contained in:
5
.changeset/blue-steaks-explode.md
Normal file
5
.changeset/blue-steaks-explode.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"reacord": patch
|
||||
---
|
||||
|
||||
ensure message is edited from arbitrary component updates
|
||||
@@ -245,7 +245,11 @@ export class ReacordDiscordJs extends Reacord {
|
||||
id: interaction.id,
|
||||
customId: interaction.customId,
|
||||
update: async (options: MessageOptions) => {
|
||||
await interaction.update(getDiscordMessageOptions(options))
|
||||
if (interaction.deferred || interaction.replied) {
|
||||
await interaction.message.edit(getDiscordMessageOptions(options))
|
||||
} else {
|
||||
await interaction.update(getDiscordMessageOptions(options))
|
||||
}
|
||||
},
|
||||
deferUpdate: async () => {
|
||||
if (interaction.replied || interaction.deferred) return
|
||||
|
||||
Reference in New Issue
Block a user