#If condition not met, still executes (GIF inside)
2 messages · Page 1 of 1 (latest)
[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: [] });
});
}
}```