I want to make one command only for admins.
//comando nick
if(comando === 'nick'){
if (message.author.permissions.has(!Permissions.STAGE_MODERATOR)) return message.reply('No Perms!');
else{
if(args == ''){
message.channel.send(`my message`);
}
else{
message.guild.members.cache.get(client.user.id).setNickname(`${args}`);
message.channel.send(`my message`);
}
}
}
but i'm having this issue:
if (message.author.permissions.has(!Permissions.STAGE_MODERATOR)) return message.reply('No Perms!');
TypeError: Cannot read properties of undefined (reading 'has')
I taken this code in Discord Js docs, but isn't working