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/utility/fortnitestats.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/commands/utility/fortnitestats.ts') diff --git a/src/commands/utility/fortnitestats.ts b/src/commands/utility/fortnitestats.ts index 01f1f99..8eb65c4 100644 --- a/src/commands/utility/fortnitestats.ts +++ b/src/commands/utility/fortnitestats.ts @@ -1,12 +1,13 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; +//@ts-ignore to types import emoji from 'emoji-random' import axios from 'axios' import config from '../../config.json' const platforms = ['pc', 'xbl', 'psn'] module.exports = class FortniteStatsUtility extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'fortnitestats', aliases: [ @@ -40,7 +41,7 @@ module.exports = class FortniteStatsUtility extends Command { key: 'pPlatform', prompt: 'What platform would you like to search on.', type: 'string', - parse: platform => platform.toLowerCase(), + parse: (platform: string) => platform.toLowerCase(), oneOf: platforms }, { @@ -51,7 +52,9 @@ module.exports = class FortniteStatsUtility extends Command { ] }); } - async run(msg: CommandoMessage, { pPlatform, pUsername }) { + //TODO: + //@ts-ignore this is not async + async run(msg: CommandoMessage, { pPlatform, pUsername }: any) { try { const stats = ( await axios @@ -62,6 +65,7 @@ module.exports = class FortniteStatsUtility extends Command { console.error(err) return msg.reply('Woops, There was an error with the (https://api.fortnitetracker.com) API. ' + emoji.random()) }) + //@ts-ignore yes it does exist lmao ).data if (stats.error === 'Player Not Found') { @@ -96,7 +100,7 @@ module.exports = class FortniteStatsUtility extends Command { return msg.replyEmbed(emb); } finally { - msg.channel.stopTyping() + return msg.channel.stopTyping() } } }; \ No newline at end of file -- cgit v1.2.3