0
const Discord = require('discord.js');
module.exports.run = (client, msg, args) => {
msg.delete();
let type = args[0];
let types = ['available', 'idle', 'dnd', 'invisible']
if(!type === types[0] || types[1] || types[2] || types[3]) return msg.channel.send(new Discord.RichEmbed().setAuthor('Error').setDescription('Sintaxe errada.'))
}
Basically, when I run the command wrong, embed is sent, but when I run it right, it still embed is sent.
Someone to help? :)
As its name says this is Stackoverflow in Portuguese, translate your question or post it on the international website.
– anonimo
Sorry... I’ll change it.
– much
There is no comparison of the type
variavel === 'A' || 'B'
. The answer given below is correct, but if you need to make aif
of the kind, should makevariavel === 'A' || variavel === 'B'
– Rafael Tavares