mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
31 lines
869 B
JavaScript
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}.`);
|
|
}
|
|
};
|