diff options
| author | 8cy <[email protected]> | 2020-04-27 08:00:29 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-27 08:00:29 -0700 |
| commit | 0d35c0116c38d1f8642e4c8d8f36509f7500bb05 (patch) | |
| tree | 24532f9d04bd1465b5b4d21bde18d86812646f45 /src/commands/moderation | |
| parent | add welcome command, v7.8.0 (diff) | |
| download | dep-core-0d35c0116c38d1f8642e4c8d8f36509f7500bb05.tar.xz dep-core-0d35c0116c38d1f8642e4c8d8f36509f7500bb05.zip | |
A New World, v8.0.0
- change some formatting
- add throttling to all commands
- change timout in welcome and clear
- add another edge case to welcome and darling
- use new mongo.connect params for stability
- move some commands around
- remove some tsingnores for idk
in total, epic update 8)
Diffstat (limited to 'src/commands/moderation')
| -rw-r--r-- | src/commands/moderation/addrole.ts | 7 | ||||
| -rw-r--r-- | src/commands/moderation/ban.ts | 11 | ||||
| -rw-r--r-- | src/commands/moderation/clear.ts | 28 | ||||
| -rw-r--r-- | src/commands/moderation/kick.ts | 11 | ||||
| -rw-r--r-- | src/commands/moderation/removerole.ts | 7 |
5 files changed, 47 insertions, 17 deletions
diff --git a/src/commands/moderation/addrole.ts b/src/commands/moderation/addrole.ts index ac0dbb6..93645a2 100644 --- a/src/commands/moderation/addrole.ts +++ b/src/commands/moderation/addrole.ts @@ -28,7 +28,12 @@ module.exports = class AddRoleModeration extends Command { 'uwu!addrole @sin#1337 @CoolRole', 'uwu!roleadd @sin#1337', 'uwu!roleadd @sin#1337 @CoolerRole' - ] + ], + throttling: { + usages: 5, + duration: 30 + }, + guildOnly: true }); } run(msg: CommandoMessage, { userID, roleID }) { diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 45f5298..5e9be5e 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -10,7 +10,12 @@ module.exports = class BanModeration extends Command { description: 'Ban someone.', userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'BAN_MEMBERS'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'BAN_MEMBERS'], - examples: ['uwu!ban @sin#1337'] + examples: ['uwu!ban @sin#1337'], + guildOnly: true, + throttling: { + usages: 5, + duration: 30 + }, }); } run(msg: CommandoMessage) { @@ -19,7 +24,9 @@ module.exports = class BanModeration extends Command { msg.reply('Member does not exist in server.') } else { msg.guild.members.ban(userID) - msg.say(`User **${userID}** has been banned!`) + msg.say(`User **${userID}** has been banned!`).then(m => { + m.react('🇫'); + }) } } };
\ No newline at end of file diff --git a/src/commands/moderation/clear.ts b/src/commands/moderation/clear.ts index e83d023..c2f44ab 100644 --- a/src/commands/moderation/clear.ts +++ b/src/commands/moderation/clear.ts @@ -5,7 +5,7 @@ module.exports = class ClearBot extends Command { constructor(client) { super(client, { name: 'clear', - aliases: ['delete', 'del', 'c', 'd'], + aliases: ['delete', 'del', 'c'], group: 'bot', memberName: 'clear', description: 'Clears a specified amount of messages.', @@ -24,6 +24,10 @@ module.exports = class ClearBot extends Command { 'uwu!c 45', 'uwu!d 84' ], + throttling: { + usages: 5, + duration: 30 + }, userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'] }); @@ -32,23 +36,23 @@ module.exports = class ClearBot extends Command { if (msg.member.hasPermission('MANAGE_MESSAGES')) { if (!deleteAmount) { msg.reply('You haven\'t specified an amount of messages which should be deleted. ' + emoji.random()).then(deleteNotificationMessage => { - // @ts-ignore - deleteNotificationMessage.delete({ timeout: 1000 }); + deleteNotificationMessage.delete({ timeout: 2000 }); + msg.delete({ timeout: 2000 }) }); } else if (isNaN(deleteAmount)) { msg.reply('The amount parameter isn\'t a number. ' + emoji.random()).then(deleteNotificationMessage => { - // @ts-ignore - deleteNotificationMessage.delete({ timeout: 1000 }); + deleteNotificationMessage.delete({ timeout: 2000 }); + msg.delete({ timeout: 2000 }) }); } else if (deleteAmount > 100) { msg.reply('You can\'t delete more than 100 messages at once. ' + emoji.random()).then(deleteNotificationMessage => { - // @ts-ignore - deleteNotificationMessage.delete({ timeout: 1000 }); + deleteNotificationMessage.delete({ timeout: 2000 }); + msg.delete({ timeout: 2000 }) }); } else if (deleteAmount < 1) { msg.reply('You have to delete at least 1 message. ' + emoji.random()).then(deleteNotificationMessage => { - // @ts-ignore - deleteNotificationMessage.delete({ timeout: 1000 }); + deleteNotificationMessage.delete({ timeout: 2000 }); + msg.delete({ timeout: 2000 }) }); } /*else if (msg.createdTimestamp > 1209600) { @@ -63,11 +67,13 @@ module.exports = class ClearBot extends Command { await msg.channel.messages.fetch({ limit: clearAmount }).then(messages => { // I am on v11 discord.js + // why the hell did i put this msg here lol, its 07:56 on 2020/04/27 and i woke up at 6am and i dont really know + // why i put this msg here lol, i am on v12 so that msg mustve been a while ago lol msg.channel.bulkDelete(messages); }); msg.reply('It\'s been deleted ~uwu ' + emoji.random()).then(deleteNotificationMessage => { - // @ts-ignore - deleteNotificationMessage.delete({ timeout: 1000 }); + deleteNotificationMessage.delete({ timeout: 2000 }); + msg.delete({ timeout: 2000 }) }); } } else { diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index 24b669d..5f6a789 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -14,7 +14,12 @@ module.exports = class KickModeration extends Command { 'uwu!kick @sin#1337', 'uwu!kickuser @sin#1337', 'uwu!kick-user @sin#1337' - ] + ], + throttling: { + usages: 5, + duration: 30 + }, + guildOnly: true }); } run(msg: CommandoMessage) { @@ -23,7 +28,9 @@ module.exports = class KickModeration extends Command { msg.reply('Member does not exist in server.') } else { msg.guild.members.prune(userID) - msg.say(`User **${userID}** has been kicked!`) + msg.say(`User **${userID}** has been kicked!`).then(m => { + m.react('🇫'); + }) } } };
\ No newline at end of file diff --git a/src/commands/moderation/removerole.ts b/src/commands/moderation/removerole.ts index a4edc92..d796cb9 100644 --- a/src/commands/moderation/removerole.ts +++ b/src/commands/moderation/removerole.ts @@ -20,6 +20,11 @@ module.exports = class RemoveRoleModeration extends Command { type: 'string' } ], + throttling: { + usages: 5, + duration: 30 + }, + guildOnly: true, userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'BAN_MEMBERS'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'BAN_MEMBERS'], examples: [ @@ -37,7 +42,7 @@ module.exports = class RemoveRoleModeration extends Command { if (role) { console.log(role) member?.roles.remove(role) - msg.reply(`The role **${role}** has been remove from **${member}**.`) + 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.') |