deferReply()

hello, is there any way to remove that message after the program is finished?
No description
DT
d.js toolkit91d 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
T
treble/luna91d ago
To what is that a reply which type of interaction is it
H
hayf091d 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'
DD
d.js docs91d 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(…)
T
treble/luna91d ago
thats one thing and use deferUpdate on the ButtonInteraction
H
hayf091d 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
T
treble/luna91d ago
Creating collectors on the channzl will causes issues eventually anyhow
Want results from more Discord servers?
Add your server
More Posts
hi guys How can I show when the user entered the server in the embed?hi guys How can I show when the user entered the server in the embed?Can someone explain me how I can use the sequelize?I coppied the repo from discord.js but how I can test the content? In my DBInteractions overlapping? (I don't know what even happening anymore)I have command that sends a ephemeral message with buttons, and then using message collector to get URL Audio Resource Streaming Stopped Workingidk whats going on so maybe one of you can help... my bot has been broken for a few months I thoughtHow to make an autocomplete list from mongodb entriesSo I have an array of objects, i want to display the name field of each object in a list, and then oSend message to specific channelHow can I send a message to a specific channel of my guild?Ticket SupportWhy when i run the bot, the terminal gave me this error?Can someone help to complete this command?I have a ticket command here, but I don't know how to make a channel that opens from a button:Webhook send channelId optionIs it possible to parse a channel ID on the webhook.send method for it to send to a thread rather thIssue with Select MenuHello, I'm new with select menus, I tried them today but the bot isn't responding to them. The consoinvalid from body```DiscordAPIError[50035]: Invalid Form Body 14.options[3][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]invalid from body```DiscordAPIError[50035]: Invalid Form Body 14.options[3][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]LatencyAfter I created shards for bot, latency went from 8-10 to 200 and this happens sometimesmodal submit unknown interaction```js await interaction.showModal(modal); //ButtonInteraction const filter = (i) => MODALhey, how can add textlabel in modal please?Add points to multiple users at onceI want to make 3 optional options to add points to multiple users at once, How can I achieve that wiAuthentication failed at WebSocketShard.onCloseI get this error once every few weeks and discord resets my bot's token. ```Unhandled rejection: AutFor some reason my collecter won't work?It doesn't give me an error or anything and ive been debugging for about 6 hours now. Any pointers aEmbed is only sending once every time the slash command is ran every active sessionBy every active session I mean every time the bot is online. I have a slash command that is like anDownload Node JS without admin rightsHello i want to know if it's possible to install node js npm without admin rights please