OwlShogunate
OwlShogunate
DIAdiscord.js - Imagine a boo! 👻
Created by OwlShogunate on 12/19/2023 in #djs-questions
Select Menu Collector
Having some trouble with my collector, per usual since last time I did it took me forever as well. Just threw this together looking through some docs, tutorials, and stackoverflow. The menu pops up and my options are correct but my collector just never collects. Discord.js Version 14.14.1, node version 18.16.0, here's my code:
menuSelect: async function(interaction, results){
const menu = new Discord.StringSelectMenuBuilder().setCustomId("menu").setPlaceholder('Make a selection!');
const options = [];

for(result of results){
options.push(new Discord.StringSelectMenuOptionBuilder().setLabel(result.name).setDescription('placeholder').setValue(result.name));
}
menu.setOptions(...options);

const row = new Discord.ActionRowBuilder().addComponents(menu);
const response = await interaction.reply({ content: 'Choose your card!', components: [row], ephemeral: true });
const collector = response.createMessageComponentCollector({
componentType: Discord.ComponentType.StringSelect,
filter: (i) => i.user.id === interaction.user.id && i.customId === interaction.id,
time: 10000, //10 seconds,
fetchReply: true
});

collector.on('collect', (interaction) => {
console.log("here!")
interaction.reply('yeet');
})
},
menuSelect: async function(interaction, results){
const menu = new Discord.StringSelectMenuBuilder().setCustomId("menu").setPlaceholder('Make a selection!');
const options = [];

for(result of results){
options.push(new Discord.StringSelectMenuOptionBuilder().setLabel(result.name).setDescription('placeholder').setValue(result.name));
}
menu.setOptions(...options);

const row = new Discord.ActionRowBuilder().addComponents(menu);
const response = await interaction.reply({ content: 'Choose your card!', components: [row], ephemeral: true });
const collector = response.createMessageComponentCollector({
componentType: Discord.ComponentType.StringSelect,
filter: (i) => i.user.id === interaction.user.id && i.customId === interaction.id,
time: 10000, //10 seconds,
fetchReply: true
});

collector.on('collect', (interaction) => {
console.log("here!")
interaction.reply('yeet');
})
},
15 replies
DIAdiscord.js - Imagine a boo! 👻
Created by OwlShogunate on 12/8/2023 in #djs-questions
Permanent Collector?
Hey all, just wondering if there was anything like a permanent collector. I haven't seen anything around the documentation I've read before, but I recently found that MatterMost essentially stores actions in buttons to make permanent events happen so I was wondering if Discord had a similar abililty. Let me know if you know of a way, and thanks in advance. Currently on discord.js version 14.11 and node 18.16.0 but open to upgrading if necessary
5 replies