hayf0
hayf0
DIAdiscord.js - Imagine an app
Created by hayf0 on 2/14/2024 in #djs-questions
deferReply()
im waiting for 2 users to click on buttons. Rock paper scissors game to be more specific
11 replies
DIAdiscord.js - Imagine an app
Created by hayf0 on 2/14/2024 in #djs-questions
deferReply()
okay, thank you for explanation, will try to edit the code. yes
11 replies
DIAdiscord.js - Imagine an app
Created by hayf0 on 2/14/2024 in #djs-questions
deferReply()
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'
11 replies