From c6d45a94b0e3bbcb0b2e01ed8e35428040126c45 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Tue, 28 Apr 2020 13:16:40 -0700 Subject: The Return, v8.2.0 - add goodbye - add avatar alias to pfp - add rule34, gelbooru and danbooru - fix ban and kick - add advice - add motivation alias to motivate --- src/commands/moderation/ban.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/commands/moderation/ban.ts') diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 5e9be5e..b33a344 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -1,4 +1,5 @@ import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random' module.exports = class BanModeration extends Command { constructor(client) { @@ -10,21 +11,31 @@ 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'], - guildOnly: true, + examples: [ + 'uwu!ban @sin#1337', + 'uwu!banuser @sin#1337', + 'uwu!ban-user @sin#1337' + ], throttling: { usages: 5, duration: 30 }, + guildOnly: true }); } run(msg: CommandoMessage) { - let userID = msg.mentions.members?.first().id - if (!msg.guild.member(userID)) { + let userID = msg.mentions.members?.first() + if (!userID?.id) { + msg.reply('No member was mentioned. ' + emoji.random()) + } else if (userID?.id == msg.author.id) { + msg.reply('You cannot ban yourself.' + emoji.random()) + } else if (userID?.id == this.client.user?.id) { + msg.reply('Not funny. ' + emoji.random()) + } else if (!msg.guild.member(userID.id)) { msg.reply('Member does not exist in server.') } else { - msg.guild.members.ban(userID) - msg.say(`User **${userID}** has been banned!`).then(m => { + msg.guild.members.ban(userID.id) + msg.say(`**${userID}** has been banned!`).then(m => { m.react('🇫'); }) } -- cgit v1.2.3