client.on(‘message’, message => {
if(message.content.startsWith(prefix + ‘unmute’)){
let user = message.mentions.users.first();
let role = message.guild.roles.find(r => r.name === 'Muted');
if(!user.roles.has(role)) {
return message.channel.send(He is not muted
);
}
user.removeRole(role).then(message.channel.send(Unmuted ${user}
));
}
});
Basically it just won’t take the role away, I have already done the mute and that gives the role. But it the unmute command won’t take it away.