mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
eslint config aqua
This commit is contained in:
@@ -2,30 +2,30 @@ const Command = require('../../structures/Command');
|
||||
const eastereggs = require('../../assets/json/easter-egg');
|
||||
|
||||
module.exports = class EasterEggCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'easter-egg',
|
||||
aliases: ['tag'],
|
||||
group: 'random',
|
||||
memberName: 'easter-egg',
|
||||
description: 'Can you discover all the easter eggs?',
|
||||
args: [
|
||||
{
|
||||
key: 'tag',
|
||||
prompt: 'What easter egg do you want to view?',
|
||||
type: 'string',
|
||||
validate: (tag) => {
|
||||
if (eastereggs[tag.toLowerCase()]) return true;
|
||||
else return 'Nope, that\'s not a valid easter egg. Try again!';
|
||||
},
|
||||
parse: (tag) => tag.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'easter-egg',
|
||||
aliases: ['tag'],
|
||||
group: 'random',
|
||||
memberName: 'easter-egg',
|
||||
description: 'Can you discover all the easter eggs?',
|
||||
args: [
|
||||
{
|
||||
key: 'tag',
|
||||
prompt: 'What easter egg do you want to view?',
|
||||
type: 'string',
|
||||
validate: tag => {
|
||||
if (eastereggs[tag.toLowerCase()]) return true;
|
||||
return 'Nope, that\'s not a valid easter egg. Try again!';
|
||||
},
|
||||
parse: tag => tag.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return msg.say(eastereggs[tag]);
|
||||
}
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return msg.say(eastereggs[tag]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class GiveFlowerCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'give-flower',
|
||||
group: 'random',
|
||||
memberName: 'give-flower',
|
||||
description: 'Gives Xiao Pai a flower.'
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'give-flower',
|
||||
group: 'random',
|
||||
memberName: 'give-flower',
|
||||
description: 'Gives Xiao Pai a flower.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
}
|
||||
run(msg) {
|
||||
return msg.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,45 +4,45 @@ const snekfetch = require('snekfetch');
|
||||
const signs = require('../../assets/json/horoscope');
|
||||
|
||||
module.exports = class HoroscopeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'horoscope',
|
||||
group: 'random',
|
||||
memberName: 'horoscope',
|
||||
description: 'Responds with today\'s horoscope for a particular sign.',
|
||||
details: `**Signs:** ${signs.join(', ')}`,
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'sign',
|
||||
prompt: 'Which sign would you like to get the horoscope for?',
|
||||
type: 'string',
|
||||
validate: (sign) => {
|
||||
if (signs.includes(sign.toLowerCase())) return true;
|
||||
else return 'Invalid sign. Use `help horoscope` for a list of signs.';
|
||||
},
|
||||
parse: (sign) => sign.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'horoscope',
|
||||
group: 'random',
|
||||
memberName: 'horoscope',
|
||||
description: 'Responds with today\'s horoscope for a particular sign.',
|
||||
details: `**Signs:** ${signs.join(', ')}`,
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'sign',
|
||||
prompt: 'Which sign would you like to get the horoscope for?',
|
||||
type: 'string',
|
||||
validate: sign => {
|
||||
if (signs.includes(sign.toLowerCase())) return true;
|
||||
return 'Invalid sign. Use `help horoscope` for a list of signs.';
|
||||
},
|
||||
parse: sign => sign.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { sign } = args;
|
||||
const { text } = await snekfetch
|
||||
.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today`);
|
||||
const body = JSON.parse(text);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(`Horoscope for ${body.sunsign}...`)
|
||||
.setTimestamp()
|
||||
.setDescription(body.horoscope)
|
||||
.addField('Mood',
|
||||
body.meta.mood, true)
|
||||
.addField('Intensity',
|
||||
body.meta.intensity, true)
|
||||
.addField('Date',
|
||||
body.date, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
async run(msg, args) {
|
||||
const { sign } = args;
|
||||
const { text } = await snekfetch
|
||||
.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today`);
|
||||
const body = JSON.parse(text);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(`Horoscope for ${body.sunsign}...`)
|
||||
.setTimestamp()
|
||||
.setDescription(body.horoscope)
|
||||
.addField('Mood',
|
||||
body.meta.mood, true)
|
||||
.addField('Intensity',
|
||||
body.meta.intensity, true)
|
||||
.addField('Date',
|
||||
body.date, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
+11
-11
@@ -1,16 +1,16 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LennyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lenny',
|
||||
group: 'random',
|
||||
memberName: 'lenny',
|
||||
description: 'Responds with the lenny face.'
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lenny',
|
||||
group: 'random',
|
||||
memberName: 'lenny',
|
||||
description: 'Responds with the lenny face.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say('( ͡° ͜ʖ ͡°)');
|
||||
}
|
||||
run(msg) {
|
||||
return msg.say('( ͡° ͜ʖ ͡°)');
|
||||
}
|
||||
};
|
||||
|
||||
+20
-20
@@ -1,25 +1,25 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LMGTFYCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lmgtfy',
|
||||
group: 'random',
|
||||
memberName: 'lmgtfy',
|
||||
description: 'Creates a LMGTFY link with the query you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like the link to search for?',
|
||||
type: 'string',
|
||||
parse: (query) => encodeURIComponent(query)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lmgtfy',
|
||||
group: 'random',
|
||||
memberName: 'lmgtfy',
|
||||
description: 'Creates a LMGTFY link with the query you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like the link to search for?',
|
||||
type: 'string',
|
||||
parse: query => encodeURIComponent(query)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { query } = args;
|
||||
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
}
|
||||
run(msg, args) {
|
||||
const { query } = args;
|
||||
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PortalSendCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'portal-send',
|
||||
group: 'random',
|
||||
memberName: 'portal-send',
|
||||
description: 'Send a message to a random channel that has a portal open.',
|
||||
guildOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'message',
|
||||
prompt: 'What message do you want to send?',
|
||||
type: 'string',
|
||||
validate: (message) => {
|
||||
if (message.length > 1500) return 'Message must be under 1500 characters.';
|
||||
else if (!/(discord(\.gg\/|app\.com\/invite\/|\.me\/))/gi.test(message)) return true;
|
||||
else return 'Please do not send invites.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'portal-send',
|
||||
group: 'random',
|
||||
memberName: 'portal-send',
|
||||
description: 'Send a message to a random channel that has a portal open.',
|
||||
guildOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'message',
|
||||
prompt: 'What message do you want to send?',
|
||||
type: 'string',
|
||||
validate: message => {
|
||||
if (message.length > 1500) return 'Message must be under 1500 characters.';
|
||||
if (!/discord(\.gg\/|app\.com\/invite\/|\.me\/)/gi.test(message)) return true;
|
||||
return 'Please do not send invites.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { message } = args;
|
||||
const channel = this.client.channels.filter((c) => {
|
||||
if (c.type !== 'text' || !c.topic || msg.guild.id === c.guild.id) return false;
|
||||
else if (c.topic.includes('<portal>')) return true;
|
||||
else return false;
|
||||
}).random();
|
||||
if (!channel) return msg.say('Aww... No channel has an open portal...');
|
||||
try {
|
||||
await channel.send(`**${msg.author.tag} (${msg.guild.name}):** ${message}`);
|
||||
return msg.say(`Message sent to **${channel.guild.name}**!`);
|
||||
} catch (err) {
|
||||
return msg.say('Failed to send message...');
|
||||
}
|
||||
}
|
||||
async run(msg, args) {
|
||||
const { message } = args;
|
||||
const channel = this.client.channels.filter(c => {
|
||||
if (c.type !== 'text' || !c.topic || msg.guild.id === c.guild.id) return false;
|
||||
else if (c.topic.includes('<portal>')) return true;
|
||||
return false;
|
||||
}).random();
|
||||
if (!channel) return msg.say('Aww... No channel has an open portal...');
|
||||
try {
|
||||
await channel.send(`**${msg.author.tag} (${msg.guild.name}):** ${message}`);
|
||||
return msg.say(`Message sent to **${channel.guild.name}**!`);
|
||||
} catch (err) {
|
||||
return msg.say('Failed to send message...');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+12
-12
@@ -1,17 +1,17 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class SpamCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'spam',
|
||||
group: 'random',
|
||||
memberName: 'spam',
|
||||
description: 'Responds with a picture of Spam.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'spam',
|
||||
group: 'random',
|
||||
memberName: 'spam',
|
||||
description: 'Responds with a picture of Spam.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: ['https://i.imgur.com/arx7GJV.jpg'] });
|
||||
}
|
||||
run(msg) {
|
||||
return msg.say({ files: ['https://i.imgur.com/arx7GJV.jpg'] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,46 +3,46 @@ const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class StrawpollCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'strawpoll',
|
||||
group: 'random',
|
||||
memberName: 'strawpoll',
|
||||
description: 'Creates a Strawpoll from the options you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'title',
|
||||
prompt: 'What would you like the title of the Strawpoll to be?',
|
||||
type: 'string',
|
||||
validate: (title) => {
|
||||
if (title.length < 200) return true;
|
||||
else return 'Title must be under 200 characters.';
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'options',
|
||||
prompt: 'What options do you want to be able to pick from? Maximum of 30.',
|
||||
type: 'string',
|
||||
infinite: true,
|
||||
validate: (choice) => {
|
||||
if (choice.length < 140) return true;
|
||||
else return 'Choices must be under 140 characters each.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'strawpoll',
|
||||
group: 'random',
|
||||
memberName: 'strawpoll',
|
||||
description: 'Creates a Strawpoll from the options you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'title',
|
||||
prompt: 'What would you like the title of the Strawpoll to be?',
|
||||
type: 'string',
|
||||
validate: title => {
|
||||
if (title.length < 200) return true;
|
||||
return 'Title must be under 200 characters.';
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'options',
|
||||
prompt: 'What options do you want to be able to pick from? Maximum of 30.',
|
||||
type: 'string',
|
||||
infinite: true,
|
||||
validate: choice => {
|
||||
if (choice.length < 140) return true;
|
||||
return 'Choices must be under 140 characters each.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { title, options } = args;
|
||||
if (options.length < 2) return msg.say('You provided less than two choices.');
|
||||
if (options.length > 31) return msg.say('You provided more than thirty choices.');
|
||||
const { body } = await snekfetch
|
||||
.post('https://strawpoll.me/api/v2/polls')
|
||||
.send({ title, options });
|
||||
return msg.say(stripIndents`
|
||||
${body.title}
|
||||
http://strawpoll.me/${body.id}
|
||||
`);
|
||||
}
|
||||
async run(msg, args) {
|
||||
const { title, options } = args;
|
||||
if (options.length < 2) return msg.say('You provided less than two choices.');
|
||||
if (options.length > 31) return msg.say('You provided more than thirty choices.');
|
||||
const { body } = await snekfetch
|
||||
.post('https://strawpoll.me/api/v2/polls')
|
||||
.send({ title, options });
|
||||
return msg.say(stripIndents`
|
||||
${body.title}
|
||||
http://strawpoll.me/${body.id}
|
||||
`);
|
||||
}
|
||||
};
|
||||
|
||||
+53
-53
@@ -3,58 +3,58 @@ const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class XKCDCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'xkcd',
|
||||
aliases: ['kcd'],
|
||||
group: 'random',
|
||||
memberName: 'xkcd',
|
||||
description: 'Gets an XKCD Comic, optionally opting for today\'s or a specific number.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
prompt: 'Please enter either a specific comic number, today, or random.',
|
||||
type: 'string',
|
||||
default: 'random',
|
||||
parse: (type) => type.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'xkcd',
|
||||
aliases: ['kcd'],
|
||||
group: 'random',
|
||||
memberName: 'xkcd',
|
||||
description: 'Gets an XKCD Comic, optionally opting for today\'s or a specific number.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
prompt: 'Please enter either a specific comic number, today, or random.',
|
||||
type: 'string',
|
||||
default: 'random',
|
||||
parse: type => type.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { type } = args;
|
||||
const current = await snekfetch
|
||||
.get('https://xkcd.com/info.0.json');
|
||||
if (type === 'today') {
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${current.body.num} - ${current.body.title}`)
|
||||
.setURL(`https://xkcd.com/${current.body.num}`)
|
||||
.setImage(current.body.img)
|
||||
.setFooter(current.body.alt);
|
||||
return msg.embed(embed);
|
||||
} else if (type === 'random') {
|
||||
const random = Math.floor(Math.random() * current.body.num) + 1;
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${random}/info.0.json`);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
.setFooter(body.alt);
|
||||
return msg.embed(embed);
|
||||
} else {
|
||||
const choice = parseInt(type, 10);
|
||||
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid Number.');
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${choice}/info.0.json`);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
.setFooter(body.alt);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
}
|
||||
async run(msg, args) {
|
||||
const { type } = args;
|
||||
const current = await snekfetch
|
||||
.get('https://xkcd.com/info.0.json');
|
||||
if (type === 'today') {
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${current.body.num} - ${current.body.title}`)
|
||||
.setURL(`https://xkcd.com/${current.body.num}`)
|
||||
.setImage(current.body.img)
|
||||
.setFooter(current.body.alt);
|
||||
return msg.embed(embed);
|
||||
} else if (type === 'random') {
|
||||
const random = Math.floor(Math.random() * current.body.num) + 1;
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${random}/info.0.json`);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
.setFooter(body.alt);
|
||||
return msg.embed(embed);
|
||||
} else {
|
||||
const choice = parseInt(type, 10);
|
||||
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid Number.');
|
||||
const { body } = await snekfetch
|
||||
.get(`https://xkcd.com/${choice}/info.0.json`);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.num} - ${body.title}`)
|
||||
.setURL(`https://xkcd.com/${body.num}`)
|
||||
.setImage(body.img)
|
||||
.setFooter(body.alt);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user