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/utility/fortnitestats.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/utility/fortnitestats.ts')
| -rw-r--r-- | src/commands/utility/fortnitestats.ts | 14 |
1 files changed, 9 insertions, 5 deletions
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 |