Message vs InteractionResponse IDs
I'm setting the reply ID as a key in Code 1. edit that reply in code 2. and then try to find the key in the Map in code three. The same code works for a different flow that doesn't have the Code 2 step and has
deferReply
and editReply
instead of reply
. Is the ID of the message somehow changing after editReply
? Because that doesn't make sense to me. Or what exactly is happening. How can I get the ID of the reply in code 1 in code 3? FYI, Code 3 is a ModalSubmitInteraction
, Code 2 is a UserSelectMenuInteraction
and Code 1 is a ChatInputCommandInteraction
.
Code 1
Code 2
Code 3
Logs
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Update 1
I tried to replace
res.id
with this.event.id
(this.event is the interaction) and then use .has(this.event.id);
instead. No luck.
maybe I'm not getting any IDs because code 1's reply doesnt have an embed? I don't think that's how it works though...
Update 2
I fixed the issue by using deferReply
and editReply
in code 1. I still don't know what the problem is or why the IDs for the reply are different if I edit it.
Update 3
So .reply
returns an InteractionResponse and .editReply
returns a Message. Makes sense why the IDs would be different. Learned that .deferReply
returns InteractionResponse. that also has an ID. If I were to use the if for that, how can I retrieve it in Code 3? I know it won't be the ID of the ModalSubmitInteraction. and neither will it be the ID of Message.Add fetchReply: true to your reply options
Without it, you get an InteractionResponse, adding it will return the message instead