summaryrefslogtreecommitdiff
path: root/src/commands/moderation/kick.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/kick.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/kick.ts')
-rw-r--r--src/commands/moderation/kick.ts15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index 5f6a789..37d08e9 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -1,4 +1,5 @@
import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random'
module.exports = class KickModeration extends Command {
constructor(client) {
@@ -23,12 +24,18 @@ module.exports = class KickModeration extends Command {
});
}
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 kick 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.prune(userID)
- msg.say(`User **${userID}** has been kicked!`).then(m => {
+ msg.guild.members.prune(userID.id)
+ msg.say(`**${userID}** has been kicked!`).then(m => {
m.react('🇫');
})
}