mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Changes
This commit is contained in:
@@ -35,6 +35,7 @@ module.exports = class MathGameCommand extends Command {
|
||||
const answer = math.eval(expression).toString();
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle('You have 10 seconds to answer:')
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(expression);
|
||||
await msg.embed(embed);
|
||||
const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
|
||||
@@ -44,6 +44,7 @@ module.exports = class QuizCommand extends Command {
|
||||
answers.push(correct);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle('You have 15 seconds to answer this question:')
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(stripIndents`
|
||||
**${decodeURIComponent(body.results[0].category)}**
|
||||
${type === 'boolean' ? '**True or False:** ' : ''}${decodeURIComponent(body.results[0].question)}
|
||||
|
||||
@@ -31,6 +31,7 @@ module.exports = class TypingGameCommand extends Command {
|
||||
const time = times[difficulty];
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`You have ${time / 1000} seconds to type:`)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(sentence);
|
||||
await msg.embed(embed);
|
||||
const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
|
||||
@@ -25,12 +25,20 @@ module.exports = class MemeCommand extends Command {
|
||||
key: 'top',
|
||||
prompt: 'What should the top row of the meme to be?',
|
||||
type: 'string',
|
||||
validate: top => {
|
||||
if (top.length < 200) return true;
|
||||
return 'Please keep the top text under 200 characters.';
|
||||
},
|
||||
parse: top => encodeURIComponent(top.replace(/[ ]/g, '-'))
|
||||
},
|
||||
{
|
||||
key: 'bottom',
|
||||
prompt: 'What should the bottom row of the meme to be?',
|
||||
type: 'string',
|
||||
validate: bottom => {
|
||||
if (bottom.length < 200) return true;
|
||||
return 'Please keep the bottom text under 200 characters.';
|
||||
},
|
||||
parse: bottom => encodeURIComponent(bottom.replace(/[ ]/g, '-'))
|
||||
}
|
||||
]
|
||||
|
||||
@@ -19,8 +19,8 @@ module.exports = class FortuneCommand extends Command {
|
||||
.query({ limit: 1 });
|
||||
return msg.say(stripIndents`
|
||||
${body[0].fortune.message}
|
||||
Lotto: ${body[0].lotto.numbers.join(', ')}
|
||||
Lesson: ${body[0].lesson.chinese} (${body[0].lesson.pronunciation}): ${body[0].lesson.english}
|
||||
${body[0].lotto.numbers.join(', ')}
|
||||
${body[0].lesson.chinese} (${body[0].lesson.pronunciation}): ${body[0].lesson.english}
|
||||
`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class QuoteCommand extends Command {
|
||||
@@ -8,18 +7,13 @@ module.exports = class QuoteCommand extends Command {
|
||||
name: 'quote',
|
||||
group: 'random-res',
|
||||
memberName: 'quote',
|
||||
description: 'Responds with a random quote.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
description: 'Responds with a random quote.'
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await snekfetch
|
||||
.get('https://talaikis.com/api/quotes/random/');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setAuthor(body.author)
|
||||
.setDescription(body.quote);
|
||||
return msg.embed(embed);
|
||||
return msg.say(`${body.quote} - _${body.author}_`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,6 +30,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
if (type === 'today') {
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${current.body.num} - ${current.body.title}`)
|
||||
.setColor(0x9797FF)
|
||||
.setURL(`https://xkcd.com/${current.body.num}`)
|
||||
.setImage(current.body.img)
|
||||
.setFooter(current.body.alt);
|
||||
@@ -40,6 +41,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
.get(`https://xkcd.com/${random}/info.0.json`);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setColor(0x9797FF)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
.setFooter(body.alt);
|
||||
@@ -51,6 +53,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
.get(`https://xkcd.com/${choice}/info.0.json`);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setColor(0x9797FF)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
.setFooter(body.alt);
|
||||
|
||||
@@ -30,6 +30,7 @@ module.exports = class DiscrimCommand extends Command {
|
||||
const users = this.client.users.filter(user => user.discriminator === discrim).map(user => user.username);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${users.length} Users with the discriminator: ${discrim}`)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(users.join(', '));
|
||||
return msg.embed(embed);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "30.6.0",
|
||||
"version": "30.6.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user