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/ban.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/ban.ts')
| -rw-r--r-- | src/commands/moderation/ban.ts | 17 |
1 files changed, 10 insertions, 7 deletions
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('🇫'); }) } |