summaryrefslogtreecommitdiff
path: root/src/commands/moderation/addrole.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/addrole.ts')
-rw-r--r--src/commands/moderation/addrole.ts62
1 files changed, 29 insertions, 33 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