This commit is contained in:
Elizabeth
2017-07-12 19:33:31 -05:00
parent c80caedffe
commit afe98a18a4
181 changed files with 22 additions and 1 deletions
-31
View File
@@ -1,31 +0,0 @@
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()
}
]
});
}
run(msg, args) {
const { tag } = args;
return msg.say(eastereggs[tag]);
}
};
-16
View File
@@ -1,16 +0,0 @@
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.'
});
}
run(msg) {
return msg.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
}
};
-48
View File
@@ -1,48 +0,0 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
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()
}
]
});
}
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);
}
};
-16
View File
@@ -1,16 +0,0 @@
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.'
});
}
run(msg) {
return msg.say('( ͡° ͜ʖ ͡°)');
}
};
-25
View File
@@ -1,25 +0,0 @@
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)
}
]
});
}
run(msg, args) {
const { query } = args;
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
}
};
-41
View File
@@ -1,41 +0,0 @@
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.';
}
}
]
});
}
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...');
}
}
};
-17
View File
@@ -1,17 +0,0 @@
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']
});
}
run(msg) {
return msg.say({ files: ['https://i.imgur.com/arx7GJV.jpg'] });
}
};
-48
View File
@@ -1,48 +0,0 @@
const Command = require('../../structures/Command');
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.';
}
}
]
});
}
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}
`);
}
};
-30
View File
@@ -1,30 +0,0 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
module.exports = class TodayCommand extends Command {
constructor(client) {
super(client, {
name: 'today',
group: 'random',
memberName: 'today',
description: 'Responds with a random event that occurred today sometime in history.',
clientPermissions: ['EMBED_LINKS']
});
}
async run(msg) {
const { text } = await snekfetch
.get('http://history.muffinlabs.com/date');
const body = JSON.parse(text);
const events = body.data.Events;
const event = events[Math.floor(Math.random() * events.length)];
const embed = new MessageEmbed()
.setColor(0x9797FF)
.setURL(body.url)
.setTitle(`On this day (${body.date})...`)
.setTimestamp()
.setDescription(`${event.year}: ${event.text}`);
return msg.embed(embed);
}
};
-27
View File
@@ -1,27 +0,0 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
module.exports = class WouldYouRatherCommand extends Command {
constructor(client) {
super(client, {
name: 'would-you-rather',
aliases: ['wy-rather'],
group: 'random',
memberName: 'would-you-rather',
description: 'Responds with a random would you rather question.',
clientPermissions: ['EMBED_LINKS']
});
}
async run(msg) {
const { body } = await snekfetch
.get('http://www.rrrather.com/botapi');
const embed = new MessageEmbed()
.setTitle(`${body.title}...`)
.setURL(body.link)
.setColor(0x9797FF)
.setDescription(`${body.choicea} OR ${body.choiceb}?`);
return msg.embed(embed);
}
};