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/animals | |
| 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/animals')
| -rw-r--r-- | src/commands/animals/bunny.ts | 9 | ||||
| -rw-r--r-- | src/commands/animals/cat.ts | 9 | ||||
| -rw-r--r-- | src/commands/animals/cow.ts | 7 | ||||
| -rw-r--r-- | src/commands/animals/dog.ts | 9 | ||||
| -rw-r--r-- | src/commands/animals/duck.ts | 9 | ||||
| -rw-r--r-- | src/commands/animals/fox.ts | 9 | ||||
| -rw-r--r-- | src/commands/animals/owl.ts | 9 |
7 files changed, 34 insertions, 27 deletions
diff --git a/src/commands/animals/bunny.ts b/src/commands/animals/bunny.ts index fb3b2b8..0da4942 100644 --- a/src/commands/animals/bunny.ts +++ b/src/commands/animals/bunny.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class BunnyAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'bunny', aliases: [ @@ -29,10 +30,10 @@ module.exports = class BunnyAnimals extends Command { .setAuthor('bunnies.io') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://api.bunnies.io/v2/loop/random/?media=gif,png')).data.media.gif) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (https://api.bunnies.io) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (https://api.bunnies.io) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/cat.ts b/src/commands/animals/cat.ts index 2530830..d4781a5 100644 --- a/src/commands/animals/cat.ts +++ b/src/commands/animals/cat.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class CatAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'cat', aliases: [ @@ -29,10 +30,10 @@ module.exports = class CatAnimals extends Command { .setAuthor('random.cat', 'https://i.imgur.com/Ik0Gf0r.png', 'https://random.cat') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://aws.random.cat/meow')).data.file) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (http://random.cat) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (http://random.cat) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/cow.ts b/src/commands/animals/cow.ts index 80eedf0..3c84f09 100644 --- a/src/commands/animals/cow.ts +++ b/src/commands/animals/cow.ts @@ -1,8 +1,9 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import cows from 'cows'; module.exports = class CowAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'cow', aliases: ['cows'], @@ -21,6 +22,6 @@ module.exports = class CowAnimals extends Command { run(msg: CommandoMessage) { let cowNumber = Math.round((Math.random() * cows().length)) let cow = cows()[cowNumber] - msg.reply(`\`\`\`${cow}\`\`\``); + return msg.reply(`\`\`\`${cow}\`\`\``); } };
\ No newline at end of file diff --git a/src/commands/animals/dog.ts b/src/commands/animals/dog.ts index 118c951..0498dbf 100644 --- a/src/commands/animals/dog.ts +++ b/src/commands/animals/dog.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class DogAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'dog', aliases: [ @@ -29,10 +30,10 @@ module.exports = class DogAnimals extends Command { .setAuthor('dog.ceo', 'https://dog.ceo/img/favicon.png', 'https://dog.ceo/dog-api/') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://dog.ceo/api/breeds/image/random')).data.message) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (http://dog.ceo/dog-api) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (http://dog.ceo/dog-api) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/duck.ts b/src/commands/animals/duck.ts index dbc4f94..a3683e0 100644 --- a/src/commands/animals/duck.ts +++ b/src/commands/animals/duck.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class DuckAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'duck', aliases: [ @@ -29,10 +30,10 @@ module.exports = class DuckAnimals extends Command { .setAuthor('random-d.uk', 'https://random-d.uk/favicon.ico', 'https://random-d.uk') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://random-d.uk/api/v1/random?type=gif')).data.url) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (https://random-d.uk) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (https://random-d.uk) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/fox.ts b/src/commands/animals/fox.ts index 86cab3a..155a987 100644 --- a/src/commands/animals/fox.ts +++ b/src/commands/animals/fox.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class FoxAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'fox', aliases: [ @@ -29,10 +30,10 @@ module.exports = class FoxAnimals extends Command { .setAuthor('randomfox.ca') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://randomfox.ca/floof/')).data.image) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (https://randomfox.ca/) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (https://randomfox.ca/) API. ' + emoji.random()) } } };
\ No newline at end of file diff --git a/src/commands/animals/owl.ts b/src/commands/animals/owl.ts index 9f219ac..6a5f583 100644 --- a/src/commands/animals/owl.ts +++ b/src/commands/animals/owl.ts @@ -1,10 +1,11 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; +import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; +//@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class OwlAnimals extends Command { - constructor(client) { + constructor(client: CommandoClient) { super(client, { name: 'owl', aliases: [ @@ -29,10 +30,10 @@ module.exports = class OwlAnimals extends Command { .setAuthor('pics.floofybot.moe/owl', 'http://pics.floofybot.moe/assets/favicon.svg', 'http://pics.floofybot.moe/') .setColor(0xFFCC4D) .setImage(await (await axios.get('http://pics.floofybot.moe/owl')).data.image) - msg.say(emb) + return msg.say(emb) } catch (err) { console.log(err) - msg.reply('Woops, there was an error with the (http://pics.floofybot.moe/) API. ' + emoji.random()) + return msg.reply('Woops, there was an error with the (http://pics.floofybot.moe/) API. ' + emoji.random()) } } };
\ No newline at end of file |