#Is it possible to check if component timed out AFTER it has timed out?

21 messages · Page 1 of 1 (latest)

shell gust
#

For example, when a message is sent with a select-menu component:

 try {
  const select = await initialReply.awaitMessageComponent({ filter: i => i.user.id === interaction.user.id, time: 15_000 });
} catch (error) {
    console.log(`[setup.js]`, error);
// Instead of making a chat message appear stating the command timed out automatically, send the message if the user continues to try using the component within the message (if it exists)
}
nimble estuaryBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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 OP
agile summit
#

Edit the customId of the menu to disabled or something and handle interactions with that customId globally in your interactionCreate event?

shell gust
#

I see, smart.

#

I'll try, thanks.

agile summit
#

@shell gust re-opened

shell gust
#

Thanks, lol

#

I just need to know how to actually set the custom id

#

of an already-made component

agile summit
#

initialReply.edit(…) or <the interaction that sent the reply>.editReply(…)

#

And pass the edited components

shell gust
#

I see.. That makes sense, thanks

#

Sorry, I'm still a bit confused, because I am not seeing a parameter to change the customId through "edit".

#

Sending example

#

and

#

// This is the first reply sent after the command is ran

const initialReply = await interaction.reply({
            content: `What feature would you like to set up?`,
            ephemeral: true,
            components: [selectMenu.stringSelect(interaction, {minValue: 1, maxValue: 1, placeholder: `* Select a feature`}, featureOptions)]
        });

#

I only want the response to be "timed out" if the awaitMessageComponent times out

#

Oh, i'm supposed to just create a whole 'nother select menu component

#

DUH

#

just with the new id