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