How do I delete a message from a select menu?
I have a select menu, and i want to delete it's message when I make my selection.
if I try
interaction.deleteReply();
it fails with DiscordAPIError: Unknown Webhook
if if first do interaction.deferReply();
, it creates a second message, which i can then do deleteReply on, but that's not what I want, i want to delete the select menu message.
if I log interaction.message
it seems to return the proper message that contains the select menu, but when I try to do await interaction.message.delete()
, it crashes saying DiscordAPIError: Unknown Message
the log looks like this attached image, which seems to me means it's returning an instance of the Message class.
when i look up the message class in the documentation (https://discord.js.org/#/docs/discord.js/v13/class/Message) it says it has a delete()
method.
what am I doing wrong?11 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.image that it decided not to attach
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
the message never goes away and eventually fails
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
orly
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
you cant make the bot dismiss them either?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
weird. but good suggestion, I'll try that
SelectMenuInteraction#update()
Updates the original message of the component on which the interaction was received on.