I have a bot that works and one of the commands of the bot is (for this post I've replaced Role IDs with names):
module.exports = {
name: 'youtube',
description: "Sends a Youtube Link",
execute(message, args){
if(message.member.roles.cache.has('DJRankID')){
message.channel.send('https://www.youtube.com');
} else {message.channel.send('Sorry, you dont seem to have DJ Permissions');
}
}
}
I'm trying to add assigning the DJ role if they already have another specific role:
module.exports = {
name: 'play',
description: "Sends a Youtube Link",
execute(message, args){
if(message.member.roles.cache.has('DJRoleID')){
message.channel.send('https://www.youtube.com');
} else if(message.member.roles.cache.has('MemberRoleID')){
message.member.roles.add('DJRoleID');
message.channel.send('https://www.youtube.com');
} else if(message.member.roles.cache.has('OfficerRoleID')){
message.member.roles.add('DJRoleID');
message.channel.send('https://www.youtube.com');
} else if(message.member.roles.cache.has('LeaderRoleID')){
message.member.roles.add('DJRoleID');
message.channel.send('https://www.youtube.com');
} else if(message.member.roles.cache.has('HelperRoleID')){
message.member.roles.add('DJRoleID');
message.channel.send('https://www.youtube.com');
} else {message.channel.send('Sorry, you dont seem to have DJ Permissions');
}
}
}
Youtube command works fine but the Play command does nothing. Bot has Manage Roles enabled. Am I missing something?