You need to make it check if the user has neither of the three roles.
Since you gave ||
between the if
statements and not &&
, it will check if the user doesn't have one or more of the three roles. If the user doesn't have one or more of them, it will output the message.reply
.
If you give &&
it will check if the user has none of the three roles.
P.S: there were some bracket errors and quotation errors in your provided code.
UPDATE: "**Owner**"
has been changed to "Owner"
Here's the updated code:
case 'clear':
if(!args[1]) return message.reply('Please specify the number of messages to clear `e.g. !clear 10`')
.then(message => message.delete({timeout: 3500}));
if(!message.member.roles.cache.some(r => r.name === "Owner") && (!message.member.roles.cache.some(r => r.name === "Admin")) && (!message.member.roles.cache.some(r => r.name === "Moderator"))
{
return message.reply('You do not have permissions to clear!')
.then(message => message.delete({timeout: 3500}));
}
message.channel.bulkDelete(args[1]);
break;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…