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
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Frosty
FrostyOP3y ago
It is a buttoninteraction
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Frosty
FrostyOP3y ago
It is not ephemeral
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
Documentation suggestion for @birongliu:property ButtonInteraction#message The message to which the component was attached
Frosty
FrostyOP3y ago
Oh it says it's command interaction But it should be buttoninteraction
Jaworek
Jaworek3y ago
so its initial interaction
Frosty
FrostyOP3y ago
How to make it buttoninteraction?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Frosty
FrostyOP3y ago
I have a collector For buttons
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Jaworek
Jaworek3y ago
is your interaction param from colletor
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Frosty
FrostyOP3y ago
Ooh
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Frosty
FrostyOP3y ago
The i.message.delete works as well
Jaworek
Jaworek3y ago
interaction.deleteReply will delete message by webhook - better way i.message.delete will delete message by bot
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Jaworek
Jaworek3y ago
its one less request by bot
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Jaworek
Jaworek3y ago
u dont have to put bot token to interaction request interaction's id and token are enough
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Jaworek
Jaworek3y ago
15 minutes is still a long time
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server