I'm trying to make a command for my bot in discord.js. What it's supposed to do it, whenever the admin of the server uses it, It'll change the status. I tried making it, but it doesn't work. Here's my code:
client.on('message', message => {
if (message.content.startsWith('!status')) {
const prefix = '!';
const args = message.content.slice(prefix.length).trim().split(' ');
if (member.hasPermission('ADMINISTRATOR')) {
const activity = args.splice(2);
client.user.setActivity(activity);
}
else {
message.channel.send('You\'re not the admin of the server or bot!')
}
}
});