I have been trying to code a "/setup" command for my bot and I wanted to to be settled with select menus, diving from page to page after the user answer a question.
My issue isn't that it does not change of page, indeed, it does. It's that each time it changes of page, It tells me that interaction has failed, but it still works fine after it says this.
#"this interaction failed" while the event seems to work fine
7 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
my npm list discord.js gives me [email protected] and node -v is 18.15
Here is the portion of the code where I do change the messages each time :
const onAnswer = async (interaction, message, tabPage) => {
try {
const originalMessage = message;
let tab = tabPage;
while (tab !== "ended") {
try {
switch (tab) {
case "welcomePage":
{
message = await message.edit({
content: "Here is my context",
components: [menu("welcomeSetup")],
});
// const message1 = message; Not used anymore for now, let's keep it till setup is settled up
selection1 = await stringCollector(message, "typeOfSetup");
if (selection1[0] === "rapid") tab = "rapidChannelChoice";
else if (selection1[0] === "complex") tab = "complexPage";
}
break;
case "rapidChannelChoice": {
// await interaction.deleteReply(message);
message = await originalMessage.edit({
content: "I am the second context",
components: [menu("simpleSetupChannel")],
});
selection2 = channelCollector(message, "simpleChannelChoice");
await selection2;
if (selection2) tab = "rapidTraderRolePage";
break;
}
case "rapidTraderRolePage": {
// await interaction.deleteReply(response2);
message = await originalMessage.edit({
content: "I am the third context",
components: [menu("simpleSetupTraderRole")],
ephemeral: true,
});
selection3 = roleCollector(message, "simpleSetupTraderRoleChoice");
await selection3;
if (selection3) tab = "rapidChannelPage";
break;
}
I have been trying over and over again lots of changes like .edit or .update or .deferEdit but I can't find how to make it work so it does exactly the same as here but without the interaction failed message 😅
And when I try to select in the select menu before the loading of the bot finished, it just does not count it, and I have to validate another time the choice to make it go to the next page