mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 01:04:16 +02:00
Random Fixes
This commit is contained in:
@@ -22,7 +22,8 @@ module.exports = class AddRoleCommand extends Command {
|
||||
const { role } = args;
|
||||
const roles = msg.guild.settings.get('openRoles');
|
||||
if (!roles) return msg.say('No Roles are open to join.');
|
||||
if (!roles.has(role.id)) return msg.say('This role is not open.');
|
||||
if (!roles.has(role.id)) return msg.say(`The ${role.name} role is not open.`);
|
||||
if (msg.member.roles.has(role.id)) return msg.say(`You already have the ${role.name} role.`);
|
||||
msg.member.addRole(role);
|
||||
return msg.say(`You have been given the ${role.name} role.`);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ module.exports = class OpenRolesCommand extends Command {
|
||||
const { action, role } = args;
|
||||
const roles = msg.guild.settings.get('openRoles', new Set());
|
||||
if (action === 'add') {
|
||||
console.log(roles);
|
||||
if (roles.size > 5) return msg.say('Only 5 roles may be open.');
|
||||
if (roles.has(role.id)) return msg.say(`${role.name} is already set to open.`);
|
||||
roles.add(role.id);
|
||||
|
||||
@@ -22,7 +22,8 @@ module.exports = class RemoveRoleCommand extends Command {
|
||||
const { role } = args;
|
||||
const roles = msg.guild.settings.get('openRoles');
|
||||
if (!roles) return msg.say('No Roles are open to join.');
|
||||
if (!roles.has(role.id)) return msg.say('This role is not open.');
|
||||
if (!roles.has(role.id)) return msg.say(`The ${role.name} role is not open.`);
|
||||
if (!msg.member.roles.has(role.id)) return msg.say(`You do not have the ${role.name} role.`);
|
||||
msg.member.removeRole(role);
|
||||
return msg.say(`You have been removed from the ${role.name} role.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user