How do delete interaction message?
Hello. I have a command that when you run it, it will send a message with 2 buttons. When you press 1st button it will edit the message that works fine, but when you press the second button, it should delete the message & then send a new ephemeral message.
I use
interaction.message.delete()
but i get a error: TypeError: Cannot read properties of undefined (reading 'delete')
26 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
It is a buttoninteraction
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
It is not ephemeral
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Documentation suggestion for @birongliu: ButtonInteraction#message
The message to which the component was attached
Oh it says it's command interaction
But it should be buttoninteraction
so its initial interaction
How to make it buttoninteraction?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I have a collector
For buttons
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
is your interaction param from colletor
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Ooh
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
The
i.message.delete
works as wellinteraction.deleteReply will delete message by webhook - better way
i.message.delete will delete message by bot
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
its one less request by bot
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
u dont have to put bot token to interaction request
interaction's id and token are enough
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
15 minutes is still a long time
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View