diff options
| author | 8cy <[email protected]> | 2020-06-27 22:52:54 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-06-27 22:52:54 -0700 |
| commit | 80951013e391aab140800e4f386867e6c391553f (patch) | |
| tree | 3d7101237ef1cd8d6fe2a2fab751a2dc55ae7d84 /src/commands/moderation/kick.ts | |
| parent | more config shit (diff) | |
| download | dep-core-80951013e391aab140800e4f386867e6c391553f.tar.xz dep-core-80951013e391aab140800e4f386867e6c391553f.zip | |
add ts defs so not a lot of errors left
- made .todo file for epic error tracking
Diffstat (limited to 'src/commands/moderation/kick.ts')
| -rw-r--r-- | src/commands/moderation/kick.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index 37d08e9..c3e57a2 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore this has no types import emoji from 'emoji-random' module.exports = class KickModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'kick', aliases: ['kickuser', 'kick-user'], @@ -23,19 +24,22 @@ module.exports = class KickModeration extends Command { guildOnly: true }); } + //@ts-ignore this aint async run(msg: CommandoMessage) { let userID = msg.mentions.members?.first() if (!userID?.id) { - msg.reply('No member was mentioned. ' + emoji.random()) + return msg.reply('No member was mentioned. ' + emoji.random()) } else if (userID?.id == msg.author.id) { - msg.reply('You cannot kick yourself.' + emoji.random()) + return msg.reply('You cannot kick yourself.' + emoji.random()) } else if (userID?.id == this.client.user?.id) { - msg.reply('Not funny. ' + emoji.random()) + return msg.reply('Not funny. ' + emoji.random()) } else if (!msg.guild.member(userID.id)) { - msg.reply('Member does not exist in server.') + return msg.reply('Member does not exist in server.') } else { + //@ts-ignore stupid typescript error this exists msg.guild.members.prune(userID.id) - msg.say(`**${userID}** has been kicked!`).then(m => { + return msg.say(`**${userID}** has been kicked!`).then(m => { + //@ts-ignore this exists m.react('🇫'); }) } |