mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Frog Command
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "135.3.0",
|
||||
"version": "135.4.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"private": true,
|
||||
|
||||
Reference in New Issue
Block a user