deferReply()

hello, is there any way to remove that message after the program is finished?
No description
7 Replies
d.js toolkit
d.js toolkit11mo ago
- 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 OP
treble/luna
treble/luna11mo ago
To what is that a reply which type of interaction is it
hayf0
hayf0OP11mo ago
console.log(interaction.type) returns 2.
const challengerCollector = interaction.channel.createMessageComponentCollector({ filter: challengerFilter, time: 10000 });
const opponentCollector = interaction.channel.createMessageComponentCollector({ filter: opponentFilter, time: 10000 });

let challengerChoice, opponentChoice;

challengerCollector.on('collect', async (interaction) => {
await interaction.deferReply({ ephemeral: true });
challengerChoice = interaction.customId;
});

opponentCollector.on('collect', async (interaction) => {
await interaction.deferReply({ ephemeral: true });
opponentChoice = interaction.customId;
});
const challengerCollector = interaction.channel.createMessageComponentCollector({ filter: challengerFilter, time: 10000 });
const opponentCollector = interaction.channel.createMessageComponentCollector({ filter: opponentFilter, time: 10000 });

let challengerChoice, opponentChoice;

challengerCollector.on('collect', async (interaction) => {
await interaction.deferReply({ ephemeral: true });
challengerChoice = interaction.customId;
});

opponentCollector.on('collect', async (interaction) => {
await interaction.deferReply({ ephemeral: true });
opponentChoice = interaction.customId;
});
it is used in .on('collect'
d.js docs
d.js docs11mo ago
If you are waiting for button or select menu input from a specific message, don't create the collector on the channel. - Channel collectors return component interactions for any component within that channel.
- <Channel>.createMessageComponentCollector(…)
+ <Message>.createMessageComponentCollector(…)
- <Channel>.createMessageComponentCollector(…)
+ <Message>.createMessageComponentCollector(…)
treble/luna
treble/luna11mo ago
thats one thing and use deferUpdate on the ButtonInteraction
hayf0
hayf0OP11mo ago
okay, thank you for explanation, will try to edit the code. yes im waiting for 2 users to click on buttons. Rock paper scissors game to be more specific
treble/luna
treble/luna11mo ago
Creating collectors on the channzl will causes issues eventually anyhow
Want results from more Discord servers?
Add your server