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,
|
id: interaction.id,
|
||||||
customId: interaction.customId,
|
customId: interaction.customId,
|
||||||
update: async (options: MessageOptions) => {
|
update: async (options: MessageOptions) => {
|
||||||
|
if (interaction.deferred || interaction.replied) {
|
||||||
|
await interaction.message.edit(getDiscordMessageOptions(options))
|
||||||
|
} else {
|
||||||
await interaction.update(getDiscordMessageOptions(options))
|
await interaction.update(getDiscordMessageOptions(options))
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deferUpdate: async () => {
|
deferUpdate: async () => {
|
||||||
if (interaction.replied || interaction.deferred) return
|
if (interaction.replied || interaction.deferred) return
|
||||||
|
|||||||
Reference in New Issue
Block a user