-1
I’m trying to apply positions to those who reacted emote in 1 message, and it’s all working out, until the "if" part from within (when I try to separate the Emotes). With this he does not apply the scroll nor the message that I put for testing, but the messages "Correct message" and "Reacted" are working normally, showing him recognizing the message and that there was a reaction.
require('dotenv').config();
const Discord = require('discord.js');
const client = new Client({
partials: ['MESSAGE', 'REACTION']
});
client.on('messageReactionAdd',(reaction, user) => {
console.log("reagiu")
const { name } = reaction.emoji;
const member = reaction.message.guild.members.cache.get(user.id);
if (reaction.message.id === "803699867544453150") {
console.log("Mensagem Correta")
if (name === ""){
console.log("Emote Banana")
console.log("banana")
member.roles.add("803708086857891899")
}
if (name === "grapes"){
console.log("Emote uvas")
member.roles.add("803707738005045269")
}
}
});
what is the value of the variable
name
?– William Bruno Rocha Moraes
Mano the logic of this name is to prepare to be a "reaction" in Discord, as if it were an empty variable, and is filled when someone reacts with an emote in the message. I don’t know if my thinking is right.
– Lucas Lanfredi