Fetching a slash command reply's ID before it's sent
Title basically explains what I'm trying to do.
I'm creating a post system, but instead of constantly doing a chain of replies, I want to just edit the topmost message by passing it's ID throughout all components.
postCommand.js
I tried getting the reply ID from the deferredReply, but that returns a completely different ID to the one that get's sent. The only method that works is by setting the customId after the message was sent, and then editing the reply to add the selectMenu.
I want to do this all before the event is sent.4 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!
- ✅
Marked as resolved by staffThat's the interaction id. To get the message returned add
fetchReply: true
option.Is there a way for ephemeral messages?
It worked for normal messages, but not for ephemeral ones
You would use editReply() and specify the message id in the options.