#Difference between ChatInputCommandInteraction.reply().id and ButtonInteraction.message.id?

18 messages · Page 1 of 1 (latest)

frosty fjord
#

I'm trying to develop bot with typescript. I've send reply to the command and I get the message id with

(await i.reply({content: 'foo', components: [button]})).id

And I'm trying to receive the interaction with Events.InteractionCreate.
I want to get id of message so I've tried interaction.message.id. But it returns different between first one.
I think first value is right because when I copy the id from discord, it copies first one to my clipboard. So, how to get the base message id from interaction?

thin basin
#

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

silver shuttle
frosty fjord
#

This is the result when I call reply. In this case, I think the reply.id and interaction.message.id returns same value because I though those targets same message. Also, reply.id returns the same value when I copy it from discord. But interaction.message.id doesn't. Then where's interaction.message.id?

#

And how to get the message id of the message which contains clicked button?

silver shuttle
#

ChatInputInteraction.message doesnt exist

frosty fjord
#

I want to say the other event(ButtonInteraction)

silver shuttle
frosty fjord
#

But that returns different value with previous called reply.id

silver shuttle
#

Show your code then

frosty fjord
#
this.client.on(Events.InteractionCreate, async interaction => {
      if(!interaction.isButton()) return
      console.log(interaction.message.id)
    })

This code is for handling interaction

#
const reply = await i.reply({ content: `message`, components: [some_components_with_buttons])
console.log(reply.id)

This is calling reply(from other place which handling slash commands)

#

Ah maybe I found whats wrong with me

#

Maybe console.log(reply.id)is wrong for my case... I've focused on wrong place

#

Thanks for responding

frosty fjord