diff options
| author | 8cy <[email protected]> | 2020-04-27 17:33:27 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-27 17:33:27 -0700 |
| commit | df64667168cdc33a2a8ffe2c0fba3b5fc6414520 (patch) | |
| tree | c9535ffdf33de34bb135e5db86063142e0e81daa /src/commands/moderation | |
| parent | add support and embed cmd, v8.0.2 (diff) | |
| download | dep-core-df64667168cdc33a2a8ffe2c0fba3b5fc6414520.tar.xz dep-core-df64667168cdc33a2a8ffe2c0fba3b5fc6414520.zip | |
fix quote commands, add motivate, v8.1.0
Diffstat (limited to 'src/commands/moderation')
| -rw-r--r-- | src/commands/moderation/addrole.ts | 62 | ||||
| -rw-r--r-- | src/commands/moderation/removerole.ts | 60 |
2 files changed, 57 insertions, 65 deletions
diff --git a/src/commands/moderation/addrole.ts b/src/commands/moderation/addrole.ts index 93645a2..65b8f8b 100644 --- a/src/commands/moderation/addrole.ts +++ b/src/commands/moderation/addrole.ts @@ -1,4 +1,5 @@ import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random' module.exports = class AddRoleModeration extends Command { constructor(client) { @@ -7,20 +8,19 @@ module.exports = class AddRoleModeration extends Command { aliases: ['roleadd'], group: 'moderation', memberName: 'addrole', - description: 'Adds a role to a specific user.', - args: [ - { - key: 'userID', - prompt: 'Who would you like to add the role to? (@someone or myself)', - type: 'string', - default: '' - }, - { - key: 'roleID', - prompt: 'What role would you like to add?', - type: 'string' - } - ], + description: '[Disabled] Adds a role to a specific user.', + // args: [ + // { + // key: 'userID', + // prompt: 'Who would you like to add the role to? (@someone or myself)', + // type: 'string' + // }, + // { + // key: 'roleID', + // prompt: 'What role would you like to add?', + // type: 'string' + // } + // ], userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'BAN_MEMBERS'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'BAN_MEMBERS'], examples: [ @@ -37,24 +37,20 @@ module.exports = class AddRoleModeration extends Command { }); } run(msg: CommandoMessage, { userID, roleID }) { - let role = msg.guild.roles.cache.find(role => role === roleID); - let member = msg.mentions.members?.first(); - if (!userID) { - if (role) { - console.log(role) - member?.roles.add(role) - msg.reply(`The role **${role}** has been added to **${member}**.`) - } else { - msg.reply('Role is either non-existant or you might\'ve mispelled it.') - } - } else if (userID) { - if (role) { - console.log(role) - member?.roles.add(role) - } else { - console.log(role) - msg.reply('Role is either non-existant or you might\'ve mispelled it.') - } - } + msg.reply('Command disabled.') + // let role = roleID + // console.log('role:', role) + // let member = userID + // console.log('member:', member) + // if (role) { + // if (msg.guild.member(member)?.roles.cache.some(role)) { + // msg.reply(member + ' already has that role! ' + emoji.random()) + // } else { + // msg.guild.member(member)?.roles.add(role).catch(err => console.log(err)) + // msg.reply(`The role **${role}** has been added to **${userID}**.`) + // } + // } else { + // msg.reply('The role or user is either non-existant or you might\'ve mispelled it.') + // } } };
\ No newline at end of file diff --git a/src/commands/moderation/removerole.ts b/src/commands/moderation/removerole.ts index d796cb9..104606d 100644 --- a/src/commands/moderation/removerole.ts +++ b/src/commands/moderation/removerole.ts @@ -7,19 +7,19 @@ module.exports = class RemoveRoleModeration extends Command { aliases: ['roleremove'], group: 'moderation', memberName: 'removerole', - description: 'Removes a role to a specific user.', - args: [ - { - key: 'userID', - prompt: 'Who would you like to remove the role from? (@someone or myself)', - type: 'string' - }, - { - key: 'roleID', - prompt: 'What role would you like to remove?', - type: 'string' - } - ], + description: '[Disabled] Removes a role to a specific user.', + // args: [ + // { + // key: 'userID', + // prompt: 'Who would you like to remove the role from? (@someone or myself)', + // type: 'string' + // }, + // { + // key: 'roleID', + // prompt: 'What role would you like to remove?', + // type: 'string' + // } + // ], throttling: { usages: 5, duration: 30 @@ -36,24 +36,20 @@ module.exports = class RemoveRoleModeration extends Command { }); } run(msg: CommandoMessage, { userID, roleID }) { - let role = msg.guild.roles.cache.find(r => r.id === roleID); - let member = msg.mentions.members?.first(); - if (!userID) { - if (role) { - console.log(role) - member?.roles.remove(role) - msg.reply(`The role **${role}** has been remove from **${member}**!`) - } else { - console.log(role) - msg.reply('Role is either non-existant or you might\'ve mispelled it.') - } - } else if (!userID) { - if (roleID) { - member?.roles.remove(roleID) - } else { - console.log(roleID) - msg.reply('Role is either non-existant or you might\'ve mispelled it.') - } - } + msg.reply('Command disabled.') + // let role = roleID + // console.log('role:', role) + // let member = userID + // console.log('member:', member) + // if (role) { + // if (msg.guild.member(member)?.roles.cache.some(role)) { + // msg.reply(member + ' already has that role! ' + emoji.random()) + // } else { + // msg.guild.member(member)?.roles.remove(role).catch(err => console.log(err)) + // msg.reply(`The role **${role}** has been remove from **${userID}**.`) + // } + // } else { + // msg.reply('The role or user is either non-existant or you might\'ve mispelled it.') + // } } };
\ No newline at end of file |