This commit is contained in:
Alex Brow 2020-03-23 09:38:21 -04:00
parent 291325769b
commit 267cbb0db3
No known key found for this signature in database
GPG Key ID: F48926893F475C25

View File

@ -228,25 +228,27 @@ client.on("message", async message => {
var role = ""; var role = "";
switch(args[1]) { switch(args[1]) {
case 5: case 5:
var role = message.guild.roles.find(role => role.name === `DEFCON 5`); var role = message.guild.roles.cache.find(role => role.name === `DEFCON 5`);
member.roles.add(role); member.roles.add(role);
break; break;
case 4: case 4:
var role = message.guild.roles.find(role => role.name === `DEFCON 4`); var role = message.guild.roles.cache.find(role => role.name === `DEFCON 4`);
member.roles.add(role); member.roles.add(role);
break; break;
case 3: case 3:
var role = message.guild.roles.find(role => role.name === `DEFCON 3`); var role = message.guild.roles.cache.find(role => role.name === `DEFCON 3`);
member.roles.add(role); member.roles.add(role);
break; break;
case 2: case 2:
var role = message.guild.roles.find(role => role.name === `DEFCON 2`); var role = message.guild.roles.cache.find(role => role.name === `DEFCON 2`);
member.roles.add(role); member.roles.add(role);
break; break;
case 1: case 1:
var role = message.guild.roles.find(role => role.name === `DEFCON 1`); var role = message.guild.roles.cache.find(role => role.name === `DEFCON 1`);
member.roles.add(role); member.roles.add(role);
break; break;
default:
return message.reply(`DEFCON not set is ${args[1]} a number between 1-5?`)
}; };
return message.reply(`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`) return message.reply(`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`)
}; };