From 80951013e391aab140800e4f386867e6c391553f Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Sat, 27 Jun 2020 22:52:54 -0700 Subject: add ts defs so not a lot of errors left - made .todo file for epic error tracking --- src/commands/moderation/kick.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/commands/moderation/kick.ts') 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('🇫'); }) } -- cgit v1.2.3