Frog Command

This commit is contained in:
Dragon Fire
2021-04-18 12:50:24 -04:00
parent 4a83f006eb
commit 3287fbde38
2 changed files with 33 additions and 1 deletions
+32
View File
@@ -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!`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "135.3.0",
"version": "135.4.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"private": true,