Closed dipamsen closed 1 year ago
For clarity reasons, I'd recommend moving interaction.deferReply()
all the way to the top of the interaction handling. So it's the first thing that happens. The way you suggested it's sortof inbetween the existing fetching code.
Sure, that works as well (I was emphasizing that the call should at least be before the async call.)
Ways to respond to an interaction
(All info is sourced from Discord Developer Portal - Receiving and Responding and DiscordJS Guide - Response Methods)
Deferred Responses
interaction.reply()
must be called within 3 seconds of theexecute
function being called.interaction.deferReply()
. This will act as an acknowledgement, and the user loading state will show a<bot> is thinking...
message. It also gives a 15 minute timeframe to perform the execution of the command.interaction.editReply()
, orinteraction.followUp()
, which will edit the loading state and show the actual response. (This must be sent withing 15 minutes of receiving the interaction.)Ephemeral Responses
ephemeral: true
to any response function (reply()
,deferReply()
,followUp()
), the corresponding response will only be visible to the user who initiated the interaction, with a message below, "Only you can see this".More
interaction.followUp()
. This also has a 15 minute timeframe since receiving the interaction.interaction.editReply()
.(issue in
gif.js
)deferReply()
call should be moved above fetch to tenor api (gif.js
)Also, the comment refers to the reply as "ephemeral", which it is not (as
ephemeral: false
is set, which is also the default).