diff options
Diffstat (limited to 'src/commands/fun/datefact.ts')
| -rw-r--r-- | src/commands/fun/datefact.ts | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/commands/fun/datefact.ts b/src/commands/fun/datefact.ts deleted file mode 100644 index 378aa52..0000000 --- a/src/commands/fun/datefact.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import axios from 'axios' -import emoji from 'emoji-random' - -module.exports = class DateFactFun extends Command { - constructor(client) { - super(client, { - name: 'datefact', - aliases: [ - 'date-fact', - 'datefacts', - 'date-facts' - ], - group: 'fun', - memberName: 'datefact', - description: 'Grabs facts about a specified date.', - args: [ - { - key: 'day', - prompt: 'What day would you like to get facts for?', - type: 'integer', - max: 31, - min: 1, - default: 'random' - }, - { - key: 'month', - prompt: 'What month would you like to get facts for?', - type: 'integer', - max: 12, - min: 1, - default: 'random' - } - ], - examples: ['uwu!datefact', 'uwu!datefact 12'], - throttling: { - usages: 5, - duration: 30 - }, - userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], - clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] - }); - } - async run(msg: CommandoMessage, { day, month }) { - const uri = `http://numbersapi.com/${month === 'random' || day === 'random' ? 'random' : `${month}/${day}`}/date` - const fact = await axios.get(uri).catch(err => { - console.log(err) - msg.reply('Woops, here was an error with the (http://numbersapi.com) API. ' + emoji.random()) - }) - msg.reply(fact.data) - } -};
\ No newline at end of file |