mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Cats
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports = class XKCDCommand extends Command {
|
|||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'type',
|
key: 'type',
|
||||||
prompt: 'Would you like to get the comic for today or random?',
|
prompt: 'Please enter either a specific comic number, today, or random.',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'random'
|
default: 'random'
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ module.exports = class XKCDCommand extends Command {
|
|||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} else {
|
} else {
|
||||||
const choice = parseInt(type, 10);
|
const choice = parseInt(type, 10);
|
||||||
if (isNaN(choice) || body.num < choice || body.num < 0) return msg.say('Invalid Number');
|
if (isNaN(choice) || current.body.num < choice || choice < 0) return msg.say('Invalid Number');
|
||||||
const { body } = await snekfetch
|
const { body } = await snekfetch
|
||||||
.get(`https://xkcd.com/${choice}/info.0.json`);
|
.get(`https://xkcd.com/${choice}/info.0.json`);
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
|
|||||||
Reference in New Issue
Block a user