#Get message id from an interaction

17 messages · Page 1 of 1 (latest)

bleak steppe
#

When I press a button I want to get the message id of that button in my interactionCreate event

plush lintelBOT
#

• 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.

opal relicBOT
rugged tiger
#

<ButtonInteraction>.message.id

bleak steppe
#

wait how do I get that?

half solstice
#

get what?

bleak steppe
#

the interaction is type ChatInputCommandInteraction

#

sorry Im new to typescript

half solstice
#

use the typeguard interaction.isButton()

opal relicBOT
amber granite
bleak steppe
#

I dont understand in this event

client.on("interactionCreate", (interaction)=>{})

how do I access interaction.message.id?

amber granite
#

By… literally writing thatwaitWhat

amber granite
#

Show the code and your typings of it

#

You probably typeguard it as both CommandInteraction and ButtonInteraction somehow