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/ban.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/commands/moderation/ban.ts') diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index b33a344..6bf6168 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.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 BanModeration extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'ban', aliases: ['banuser', 'ban-user'], @@ -23,19 +24,21 @@ module.exports = class BanModeration extends Command { guildOnly: true }); } + //@ts-ignore this is not promsise based 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 ban yourself.' + emoji.random()) + return msg.reply('You cannot ban 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 { msg.guild.members.ban(userID.id) - msg.say(`**${userID}** has been banned!`).then(m => { + return msg.say(`**${userID}** has been banned!`).then(m => { + //@ts-ignore yes this exists m.react('🇫'); }) } -- cgit v1.2.3