discord.js ignores select menu input

const { Events, EmbedBuilder, ActionRowBuilder, StringSelectMenuOptionBuilder, StringSelectMenuBuilder, ComponentType } = require("discord.js");

module.exports = {
name: Events.InteractionCreate,
async execute(client, interaction) {) {
if (interaction.customId === "presetListMenu") {
// ...

let categoryResponse = await interaction.reply({
embeds: [presetCategories],
components: [...row],
ephemeral: true
});

const collector = categoryResponse.createMessageComponentCollector({
componentType: ComponentType.StringSelect,
time: 6e4 * 2
});

collector.once("collect", async (i) => {
const categorySelection = i.values[0];
console.log(categorySelection);
// ...

await interaction.editReply({
embeds: [presetCategories],
components: [],
ephemeral: true
});
});
}
const { Events, EmbedBuilder, ActionRowBuilder, StringSelectMenuOptionBuilder, StringSelectMenuBuilder, ComponentType } = require("discord.js");

module.exports = {
name: Events.InteractionCreate,
async execute(client, interaction) {) {
if (interaction.customId === "presetListMenu") {
// ...

let categoryResponse = await interaction.reply({
embeds: [presetCategories],
components: [...row],
ephemeral: true
});

const collector = categoryResponse.createMessageComponentCollector({
componentType: ComponentType.StringSelect,
time: 6e4 * 2
});

collector.once("collect", async (i) => {
const categorySelection = i.values[0];
console.log(categorySelection);
// ...

await interaction.editReply({
embeds: [presetCategories],
components: [],
ephemeral: true
});
});
}
Updated from [email protected] -> [email protected] last night and it appears to completely ignore the collector here, no output at all when selecting an option.
22 Replies
d.js toolkit
d.js toolkit17mo 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!
duck
duck17mo ago
could you share more of your code? what type of interaction is the one you're replying to with this select menu? is it a modal submit? does it behave the same if you add fetchReply: true to the reply options? does the InteractionCreate event still emit as normal for this string select menu interaction?
bussin
bussinOP17mo ago
https://sourceb.in/jveslYpMX5 It is a menu selection from a message not a modal submit fetchReply: true behaves the same, still no luck I use InteractionCreate elsewhere and it does work, doesn't work specifically in this case
duck
duck17mo ago
I use InteractionCreate elsewhere and it does work, doesn't work specifically in this case
just to clarify, do you mean that it doesn't emit at all?
bussin
bussinOP17mo ago
No it does, that's the thing. it works for a different interaction in another file https://sourceb.in/PAEHcTli1v
duck
duck17mo ago
I'm not asking about a different interaction in another file I'm asking if it emits for the interaction you're trying to collect
bussin
bussinOP17mo ago
not at all
bussin
bussinOP17mo ago
duck
duck17mo ago
this video doesn't really answer my question if you just log something at the top of your interactionCreate event listener, does it log when you use the select menu?
bussin
bussinOP17mo ago
Yes it does, the first half of my code works.. meaning it sends the reply:
// line 93
let categoryResponse = await interaction.reply({
embeds: [presetCategories],
components: [...row],
ephemeral: true
});
// line 93
let categoryResponse = await interaction.reply({
embeds: [presetCategories],
components: [...row],
ephemeral: true
});
however the issue I'm having is the collector not firing when I choose an option
duck
duck17mo ago
this also doesn't answer my question
bussin
bussinOP17mo ago
my fault zooted
duck
duck17mo ago
I'm asking whether it logs when you use the select menu that you're trying to collect the interaction for
bussin
bussinOP17mo ago
oh no it doesn't log doesn't log anything, even a string you mean this?
collector.once("collect", async (i) => {
const categorySelection = i.values[0];
console.log(categorySelection);
collector.once("collect", async (i) => {
const categorySelection = i.values[0];
console.log(categorySelection);
duck
duck17mo ago
no, log at the top of your interactionCreate listener not the collector
bussin
bussinOP17mo ago
ah yes it does log
bussin
bussinOP17mo ago
bussin
bussinOP17mo ago
const {
Events,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
StringSelectMenuOptionBuilder,
StringSelectMenuBuilder,
ComponentType
} = require("discord.js");

module.exports = {
name: Events.InteractionCreate,
async execute(client, interaction) {
console.log("INTERACTION LOGGED");
// ...
const {
Events,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
StringSelectMenuOptionBuilder,
StringSelectMenuBuilder,
ComponentType
} = require("discord.js");

module.exports = {
name: Events.InteractionCreate,
async execute(client, interaction) {
console.log("INTERACTION LOGGED");
// ...
I just don't understand what changed in v14.13 that causes the collector to not respond and the fact I have nearly identical code in another interactionCreate event file that works
duck
duck17mo ago
for your original code, I believe the issue comes from a pr that was merged for 14.12, specifically the change in how the collector's messageId is determined however I can't seem to find anything relating to if you were to add fetchReply: true in your reply options
bussin
bussinOP17mo ago
oh wow, well that's embarrassing fetchReply: true works now
duck
duck17mo ago
no worries, just glad to have isolated the issue
bussin
bussinOP17mo ago
i really appreciate it !
Want results from more Discord servers?
Add your server