This commit is contained in:
Dragon Fire
2021-04-18 12:51:46 -04:00
parent 3287fbde38
commit ac8b79e79a
+4 -8
View File
@@ -20,13 +20,9 @@ module.exports = class FrogCommand extends Command {
});
}
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!`);
}
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`] });
}
};