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
d.js docs
d.js docs3y ago
• 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.
skeddles
skeddlesOP3y ago
image that it decided not to attach
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
skeddles
skeddlesOP3y ago
the message never goes away and eventually fails
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
skeddles
skeddlesOP3y ago
orly
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
skeddles
skeddlesOP3y ago
you cant make the bot dismiss them either?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
skeddles
skeddlesOP3y ago
weird. but good suggestion, I'll try that
d.js docs
d.js docs3y ago
method SelectMenuInteraction#update() Updates the original message of the component on which the interaction was received on.
Want results from more Discord servers?
Add your server