Files
xiao/commands/settings/staff-role.js
T
Daniel Odendahl Jr 208652d270 Custom hasPermission
2017-05-28 02:30:06 +00:00

32 lines
940 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class StaffRoleCommand extends Command {
constructor(client) {
super(client, {
name: 'staff-role',
group: 'settings',
memberName: 'staff-role',
description: 'Sets the role that can use Mod Commands without perms.',
guildOnly: true,
args: [
{
key: 'role',
prompt: 'What role should be staff?',
type: 'role'
}
]
});
}
hasPermission(msg) {
if (!msg.member.hasPermission('ADMINISTRATOR')) return 'You do not have the `Administrator` Permission.';
else return true;
}
run(msg, args) {
const { role } = args;
msg.guild.settings.set('staffRole', role.id);
return msg.say(`Server Staff role set to ${role.name}.`);
}
};