summaryrefslogtreecommitdiff
path: root/src/commands/moderation/ban.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-28 13:16:40 -0700
committer8cy <[email protected]>2020-04-28 13:16:40 -0700
commitc6d45a94b0e3bbcb0b2e01ed8e35428040126c45 (patch)
tree526227612501768272e1f985d5f7c6b3671bf638 /src/commands/moderation/ban.ts
parentchange darling quote calc method, add 002 quotes to quote, v8.1.2 (diff)
downloaddep-core-c6d45a94b0e3bbcb0b2e01ed8e35428040126c45.tar.xz
dep-core-c6d45a94b0e3bbcb0b2e01ed8e35428040126c45.zip
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
Diffstat (limited to 'src/commands/moderation/ban.ts')
-rw-r--r--src/commands/moderation/ban.ts23
1 files changed, 17 insertions, 6 deletions
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('🇫');
})
}