Files
xiao/commands/random-img/frog.js
T
Dragon Fire c61ae11679 Fix
2021-06-05 12:50:41 -04:00

29 lines
744 B
JavaScript

const Command = require('../../framework/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'
}
]
});
}
run(msg) {
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`] });
}
};