Interaction Managing Duty
Hello, i'm making message & interaction manager system and got wonder why the interaction should requires to edit/add/remove the message.
Should I respond only via
interaction
object for interaction?
Can't I just give a surplus response to the discord? Do I have to change the message?15 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!
and node version is
v18.13.0
.
but i think you don't need to know about these because this is about not to implementions - but just abstract solution about managing interaction.
for an example,
if a button is clicked, the discord bot will run some logic which depends on that button clicking.
but sometimes the discord bot doesn't want to response anything to the message.
or there are no way to response, for example in my case, i want to reply interaction in another thread channel - not exactly same channel where the message is in.I think that this is a good solution:
- DeferReply
- DeleteReply
- Send a message in another thread channel
*
deferReply
is for reacting to message later, not for dismiss. isn't it?
* deleteReply
is out of the context. deleting reply is not wanted situation for every case.
* Sending a message in another channel - yes, that's what i exact have done.
but as you see, this is not replying to interaction. this is just creating new message to given channel.Generally, the "best" solution is an ephemeral reply saying something like "the message was sent successfully!". You may also need to reply if there are any errors with sending the message in the chosen channel, like if your bot is missing access/permissions, and that can be told via an interaction reply
Discord expects you to reply to every interaction for good user experience, and the rest of us devs just have to accept that expectation
Well you can deferReply and edit the reply if you want to send back feedback or delete it if you don't
If you defer and delete
Discord won't say 'this interaction wasn't responded)
Or someh like that
ah, that was some steps! i thought that was choices
It was steps
Yeah
Srry, i didn't make it 1. 2. 3.
Because you can send the message before deleting the reply
But you can also do it the other way around
So 1. Was needed but 2 and 3 could be switched
But does this help?
Or do you want something else
well, i tried (1 -> 2), 3 at the same time with ephemeral reply.
this still require to send the message but feels better!
thanks for your answers
Wait, i don't think you can delete an ephemeral msg
i know user can delete the message but that makes user to be tired.
so let it be deleted automatically
No, it's not allowed
To delete ephemeral msg
Wait I'll look in the docs
well, it works.
Oh, okay
Then i remembered it wrong