I'm trying to make it when someone's user ID matches with a variable then it'll react with ⛔. This is working for all of my other commands but whenever I use it for this one it reacts with it but then let's them run the command. Any ideas? Also sometimes the message is sent twice.
client.on('message', async message => {
// Check if the user who sent the message is in the list
if ((message.author.id) === bannedid) {
// If user is in list, then check if message matches a command
if (message.content === 'hi') {
await message.react('⛔');
}
} else if (message.content === 'hi') {
himessage(message);
function himessage(message) {
var messages = ['hi uwu', 'owo', 'no', 'stinky', 'amongus', 'The FitnessGram PACER Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The test is used to measure a students aerobic capacity as part of the FitnessGram assessment. Students run back and forth as many times as they can, each lap signaled by a beep sound. The test get progressively faster as it continues until the student reaches their max lap score. The PACER Test score is combined in the FitnessGram software with scores for muscular strength, endurance, flexibility and body composition to determine whether a student is in the Healthy Fitness Zone™ or the Needs Improvement Zone™.'];
var cheese = Math.floor(Math.random() * messages.length)
message.channel.send(messages[cheese]);
}
}
});