mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Lots of small changes
This commit is contained in:
@@ -11,7 +11,7 @@ module.exports = class BoredomCommand extends Command {
|
||||
credit: [
|
||||
{
|
||||
name: 'Bored API',
|
||||
url: 'https://www.boredapi.com/',
|
||||
url: 'https://bored.api.lewagon.com/',
|
||||
reason: 'API'
|
||||
}
|
||||
]
|
||||
@@ -19,7 +19,7 @@ module.exports = class BoredomCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await request.get('https://www.boredapi.com/api/activity/');
|
||||
const { body } = await request.get('https://bored.api.lewagon.com/api/activity/');
|
||||
return msg.say(`${body.activity} (${body.type})`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = class JokeCommand extends Command {
|
||||
if (body.type === 'twopart') {
|
||||
return msg.say(stripIndents`
|
||||
${body.setup}
|
||||
${body.delivery}
|
||||
||${body.delivery}||
|
||||
`);
|
||||
}
|
||||
return msg.say(body.joke);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
const genders = ['male', 'female', 'both'];
|
||||
const genders = {
|
||||
masculine: 'male',
|
||||
feminine: 'female',
|
||||
any: ''
|
||||
};
|
||||
|
||||
module.exports = class NameCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -21,7 +25,7 @@ module.exports = class NameCommand extends Command {
|
||||
key: 'gender',
|
||||
type: 'string',
|
||||
default: 'both',
|
||||
oneOf: genders,
|
||||
oneOf: Object.keys(genders),
|
||||
parse: gender => gender.toLowerCase()
|
||||
}
|
||||
]
|
||||
@@ -34,7 +38,7 @@ module.exports = class NameCommand extends Command {
|
||||
.query({
|
||||
inc: 'name',
|
||||
noinfo: '',
|
||||
gender: gender === 'both' ? '' : gender,
|
||||
gender: genders[gender],
|
||||
nat: 'AU,US,CA,GB'
|
||||
});
|
||||
const data = body.results[0].name;
|
||||
|
||||
@@ -12,6 +12,8 @@ module.exports = class OffspringCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const chance = Math.floor(Math.random() * 5500);
|
||||
if (!chance) return msg.say('It\'s a... Wait, what is it?');
|
||||
return msg.say(`It's a ${genders[Math.floor(Math.random() * genders.length)]}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = class PunCommand extends Command {
|
||||
if (body.type === 'twopart') {
|
||||
return msg.say(stripIndents`
|
||||
${body.setup}
|
||||
${body.delivery}
|
||||
||${body.delivery}||
|
||||
`);
|
||||
}
|
||||
return msg.say(body.joke);
|
||||
|
||||
Reference in New Issue
Block a user