Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(command === "mute") {
- let reason = args.slice(1).join(' ');
- let user = message.mentions.users.first();
- console.log("test");
- let logchannel = message.guild.channels.find('name', 'cosmos-log');
- console.log("test");
- if (!logchannel) return message.reply('I cannot find a logs channel');
- if (!message.member.hasPermission("MANAGE_MEMBERS")) return message.reply(":no_entry_sign: **Error:** You don't have the **MANAGE_MEMBERS** permission!");
- if (reason.length < 1) return message.reply('You must supply a reason for the mute.');
- if (message.mentions.users.size < 1) return message.reply('You must mention someone to mute them.').catch(console.error);
- if (!message.guild.member(user).bannable) return
- console.log("test");
- message.reply(`:no_entry_sign: I cannot mute that member`);
- console.log("test");
- message.guild.member(user).Mute();
- const embed = new Discord.RichEmbed()
- .setColor(0xFF0000)
- .setTimestamp()
- .addField('Action:', 'Mute')
- .addField('User:', `${user.username}#${user.discriminator} (${user.id})`)
- .addField('Moderator:',
- `${message.author.username}#${message.author.discriminator}`)
- .addField('Reason', reason);
- console.log("test");
- message.channel.send(`:hammer: Bippity boppity **MUTED**! I\'ve logged the mute in the logs channel.`)
- return client.channels.get(logchannel.id).send({embed});
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement