Role Management, gelbooru/danbooru/konachan

This commit is contained in:
Daniel Odendahl Jr
2018-03-05 22:14:25 +00:00
parent ff8dfba2ac
commit c53eca459e
13 changed files with 335 additions and 2 deletions
+31
View File
@@ -0,0 +1,31 @@
const { Command } = require('discord.js-commando');
module.exports = class UnsubscribeCommand extends Command {
constructor(client) {
super(client, {
name: 'unsubscribe',
aliases: ['leave'],
group: 'role-manage',
memberName: 'unsubscribe',
description: 'Unsubscribes you from the specified role.',
guildOnly: true,
clientPermissions: ['MANAGE_ROLES'],
args: [
{
key: 'role',
prompt: 'What role do you want to unsubscribe from?',
type: 'role'
}
]
});
}
async run(msg, { role }) {
const roles = msg.guild.settings.get('openRoles', []);
if (!roles.includes(role.id)) return msg.reply('This role is not open!');
if (!role.editable) return msg.reply('I do not have permission to manage this role!');
if (!msg.member.roles.has(role.id)) return msg.reply('You are not a member of this role!');
await msg.member.roles.remove(role);
return msg.say(`You were removed from **${role.name}**...`);
}
};