From 3287fbde3806376afefec533d71a072a4417d88f Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 18 Apr 2021 12:50:24 -0400 Subject: [PATCH] Frog Command --- commands/random-img/frog.js | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 commands/random-img/frog.js diff --git a/commands/random-img/frog.js b/commands/random-img/frog.js new file mode 100644 index 00000000..94a98f38 --- /dev/null +++ b/commands/random-img/frog.js @@ -0,0 +1,32 @@ +const Command = require('../../structures/Command'); + +module.exports = class FrogCommand extends Command { + constructor(client) { + super(client, { + name: 'frog', + aliases: ['ribbit'], + group: 'random-img', + memberName: 'frog', + description: 'Responds with a random frog image.', + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'FROGLAND!', + url: 'http://allaboutfrogs.org/froglnd.shtml', + reason: 'API', + reasonURL: 'http://allaboutfrogs.org/funstuff/randomfrog.html' + } + ] + }); + } + + async run(msg) { + try { + const chosen = Math.floor(Math.random() * 54) + 1; + const str = chosen.toString().padStart(4, '0'); + return msg.say({ files: [`http://www.allaboutfrogs.org/funstuff/random/${str}.jpg`] }); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/package.json b/package.json index 8fd3e7e4..da239e6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "135.3.0", + "version": "135.4.0", "description": "Your personal server companion.", "main": "Xiao.js", "private": true,