Files
xiao/commands/settings/join-role.js
T
2017-05-23 16:14:48 +00:00

31 lines
869 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class JoinRoleCommand extends Command {
constructor(client) {
super(client, {
name: 'join-role',
group: 'settings',
memberName: 'join-role',
description: 'Sets a role that new members are automatically joined to.',
guildOnly: true,
args: [
{
key: 'role',
prompt: 'What role should new members be joined to?',
type: 'role'
}
]
});
}
hasPermission(msg) {
return msg.member.hasPermission('ADMINISTRATOR');
}
run(msg, args) {
const { role } = args;
msg.guild.settings.set('joinRole', role.id);
return msg.say(`Join Role set to ${role.name}.`);
}
};