#If condition not met, still executes (GIF inside)

2 messages · Page 1 of 1 (latest)

coarse beaconBOT
#

• 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.

celest rampart
#

[email protected]
Node v18.7.0

  const role_id = "661597952568983575";
  if (role_id === "661597952568983575") {
    roleRequestChannel.messages.fetch({ around: interaction.customId.slice(6), limit: 1 })
      .then(msg => {
        msg.first().react(":crossxmark:");
      });
    interaction.channel?.messages.fetch({ around: interaction.message.id, limit: 1 })
      .then(msg => {
        msg.first()?.edit({ content: 'Vyřídil' + '<@' + interaction.user.id + '>\n **Neplatný požadavek** ', components: [] });
      });
  }
  else {
    roleRequestChannel.messages.fetch({ around: interaction.customId.slice(6), limit: 1 })
      .then(msg => {
        msg.first().react(":checkmark:");
      });

    interaction.channel?.messages.fetch({ around: interaction.message.id, limit: 1 })
      .then(msg => {
        msg.first()?.edit({ content: 'Vyřídil' + '<@' + interaction.user.id + '>\n Role přidána: ' + '<@&' + interaction.values[0] + '>', components: [] });
      });
  }
}```