MeesageEmbed

This commit is contained in:
Daniel Odendahl Jr
2017-07-03 23:49:09 +00:00
parent 7214aea5e8
commit 58807cd222
39 changed files with 79 additions and 79 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const math = require('mathjs'); const math = require('mathjs');
const { operations, difficulties, maxValues } = require('../../assets/json/math-game'); const { operations, difficulties, maxValues } = require('../../assets/json/math-game');
@@ -33,7 +33,7 @@ module.exports = class MathGameCommand extends Command {
const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1; const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
const expression = `${value1} ${operation} ${value2}`; const expression = `${value1} ${operation} ${value2}`;
const answer = math.eval(expression).toString(); const answer = math.eval(expression).toString();
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle('You have 10 seconds to answer:') .setTitle('You have 10 seconds to answer:')
.setDescription(expression); .setDescription(expression);
await msg.embed(embed); await msg.embed(embed);
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
@@ -24,7 +24,7 @@ module.exports = class QuizCommand extends Command {
encode: 'url3986' encode: 'url3986'
}); });
const answer = body.results[0].correct_answer.toLowerCase(); const answer = body.results[0].correct_answer.toLowerCase();
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle('You have 15 seconds to answer this question:') .setTitle('You have 15 seconds to answer this question:')
.setDescription(stripIndents` .setDescription(stripIndents`
**${decodeURIComponent(body.results[0].category)}** **${decodeURIComponent(body.results[0].category)}**
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { sentences, difficulties, times } = require('../../assets/json/typing-game'); const { sentences, difficulties, times } = require('../../assets/json/typing-game');
module.exports = class TypingGameCommand extends Command { module.exports = class TypingGameCommand extends Command {
@@ -29,7 +29,7 @@ module.exports = class TypingGameCommand extends Command {
const { difficulty } = args; const { difficulty } = args;
const sentence = sentences[Math.floor(Math.random() * sentences.length)]; const sentence = sentences[Math.floor(Math.random() * sentences.length)];
const time = times[difficulty]; const time = times[difficulty];
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`You have ${time / 1000} seconds to type:`) .setTitle(`You have ${time / 1000} seconds to type:`)
.setDescription(sentence); .setDescription(sentence);
await msg.embed(embed); await msg.embed(embed);
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const moment = require('moment'); const moment = require('moment');
const filterLevels = ['Off', 'No Role', 'Everyone']; const filterLevels = ['Off', 'No Role', 'Everyone'];
@@ -17,7 +17,7 @@ module.exports = class GuildInfoCommand extends Command {
} }
run(msg) { run(msg) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.setThumbnail(msg.guild.iconURL()) .setThumbnail(msg.guild.iconURL())
.addField(' Name', .addField(' Name',
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
module.exports = class BanCommand extends Command { module.exports = class BanCommand extends Command {
@@ -62,7 +62,7 @@ module.exports = class BanCommand extends Command {
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) { if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not log the ban to the mod logs.'); return msg.say('Could not log the ban to the mod logs.');
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) { } else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL()) .setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setColor(0xFF0000) .setColor(0xFF0000)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
module.exports = class KickCommand extends Command { module.exports = class KickCommand extends Command {
@@ -59,7 +59,7 @@ module.exports = class KickCommand extends Command {
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) { if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not log the kick to the mod logs.'); return msg.say('Could not log the kick to the mod logs.');
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) { } else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL()) .setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setColor(0xFFA500) .setColor(0xFFA500)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
module.exports = class SoftbanCommand extends Command { module.exports = class SoftbanCommand extends Command {
@@ -63,7 +63,7 @@ module.exports = class SoftbanCommand extends Command {
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) { if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not log the softban to the mod logs.'); return msg.say('Could not log the softban to the mod logs.');
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) { } else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL()) .setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setColor(0xFF4500) .setColor(0xFF4500)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
module.exports = class UnbanCommand extends Command { module.exports = class UnbanCommand extends Command {
@@ -53,7 +53,7 @@ module.exports = class UnbanCommand extends Command {
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) { if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not log the unban to the mod logs.'); return msg.say('Could not log the unban to the mod logs.');
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) { } else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL()) .setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setColor(0x00AE86) .setColor(0x00AE86)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
module.exports = class WarnCommand extends Command { module.exports = class WarnCommand extends Command {
@@ -56,7 +56,7 @@ module.exports = class WarnCommand extends Command {
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) { if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not log the warn to the mod logs.'); return msg.say('Could not log the warn to the mod logs.');
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) { } else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL()) .setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setColor(0xFFFF00) .setColor(0xFFFF00)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const signs = require('../../assets/json/horoscope'); const signs = require('../../assets/json/horoscope');
@@ -32,7 +32,7 @@ module.exports = class HoroscopeCommand extends Command {
const { text } = await snekfetch const { text } = await snekfetch
.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today`); .get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today`);
const body = JSON.parse(text); const body = JSON.parse(text);
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setTitle(`Horoscope for ${body.sunsign}...`) .setTitle(`Horoscope for ${body.sunsign}...`)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class TodayCommand extends Command { module.exports = class TodayCommand extends Command {
@@ -19,7 +19,7 @@ module.exports = class TodayCommand extends Command {
const body = JSON.parse(text); const body = JSON.parse(text);
const events = body.data.Events; const events = body.data.Events;
const event = events[Math.floor(Math.random() * events.length)]; const event = events[Math.floor(Math.random() * events.length)];
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setURL(body.url) .setURL(body.url)
.setTitle(`On this day (${body.date})...`) .setTitle(`On this day (${body.date})...`)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class WouldYouRatherCommand extends Command { module.exports = class WouldYouRatherCommand extends Command {
@@ -17,7 +17,7 @@ module.exports = class WouldYouRatherCommand extends Command {
async run(msg) { async run(msg) {
const { body } = await snekfetch const { body } = await snekfetch
.get('http://www.rrrather.com/botapi'); .get('http://www.rrrather.com/botapi');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`${body.title}...`) .setTitle(`${body.title}...`)
.setURL(body.link) .setURL(body.link)
.setColor(0x9797FF) .setColor(0x9797FF)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { cleanXML } = require('../../structures/Util'); const { cleanXML } = require('../../structures/Util');
const { promisifyAll } = require('tsubaki'); const { promisifyAll } = require('tsubaki');
@@ -32,7 +32,7 @@ module.exports = class AnimeCommand extends Command {
.query({ q: query }); .query({ q: query });
const { anime } = await xml.parseStringAsync(text); const { anime } = await xml.parseStringAsync(text);
const synopsis = cleanXML(anime.entry[0].synopsis[0].substr(0, 2000)); const synopsis = cleanXML(anime.entry[0].synopsis[0].substr(0, 2000));
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x2D54A2) .setColor(0x2D54A2)
.setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png') .setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png')
.setURL(`https://myanimelist.net/anime/${anime.entry[0].id[0]}`) .setURL(`https://myanimelist.net/anime/${anime.entry[0].id[0]}`)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { DBOTS_KEY } = process.env; const { DBOTS_KEY } = process.env;
@@ -27,7 +27,7 @@ module.exports = class BotSearchCommand extends Command {
const { body } = await snekfetch const { body } = await snekfetch
.get(`https://bots.discord.pw/api/bots/${bot.id}`) .get(`https://bots.discord.pw/api/bots/${bot.id}`)
.set({ Authorization: DBOTS_KEY }); .set({ Authorization: DBOTS_KEY });
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setAuthor('Discord Bots', 'https://i.imgur.com/lrKYBQi.jpg') .setAuthor('Discord Bots', 'https://i.imgur.com/lrKYBQi.jpg')
.setTitle(body.name) .setTitle(body.name)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class BulbapediaCommand extends Command { module.exports = class BulbapediaCommand extends Command {
@@ -36,7 +36,7 @@ module.exports = class BulbapediaCommand extends Command {
formatversion: 2 formatversion: 2
}); });
if (body.query.pages[0].missing) return msg.say('No Results.'); if (body.query.pages[0].missing) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x3E7614) .setColor(0x3E7614)
.setTitle(body.query.pages[0].title) .setTitle(body.query.pages[0].title)
.setAuthor('Bulbapedia', 'https://i.imgur.com/09eYo5T.png') .setAuthor('Bulbapedia', 'https://i.imgur.com/09eYo5T.png')
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { WORDNIK_KEY } = process.env; const { WORDNIK_KEY } = process.env;
@@ -33,7 +33,7 @@ module.exports = class DefineCommand extends Command {
api_key: WORDNIK_KEY api_key: WORDNIK_KEY
}); });
if (!body.length) return msg.say('No Results.'); if (!body.length) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setTitle(body[0].word) .setTitle(body[0].word)
.setDescription(body[0].text); .setDescription(body[0].text);
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
module.exports = class DiscrimCommand extends Command { module.exports = class DiscrimCommand extends Command {
constructor(client) { constructor(client) {
@@ -28,7 +28,7 @@ module.exports = class DiscrimCommand extends Command {
run(msg, args) { run(msg, args) {
const discrim = args.discrim || msg.author.discriminator; const discrim = args.discrim || msg.author.discriminator;
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 RichEmbed() const embed = new MessageEmbed()
.setTitle(`${users.length} Users with the discriminator: ${discrim}`) .setTitle(`${users.length} Users with the discriminator: ${discrim}`)
.setDescription(users.join(', ')); .setDescription(users.join(', '));
return msg.embed(embed); return msg.embed(embed);
+2 -2
View File
@@ -1,6 +1,6 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class ForecastCommand extends Command { module.exports = class ForecastCommand extends Command {
@@ -31,7 +31,7 @@ module.exports = class ForecastCommand extends Command {
}); });
if (!body.query.count) return msg.say('Location Not Found.'); if (!body.query.count) return msg.say('Location Not Found.');
const forecasts = body.query.results.channel.item.forecast; const forecasts = body.query.results.channel.item.forecast;
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x0000FF) .setColor(0x0000FF)
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png') .setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
.setURL(body.query.results.channel.link) .setURL(body.query.results.channel.link)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const moment = require('moment'); const moment = require('moment');
const { GITHUB_LOGIN } = process.env; const { GITHUB_LOGIN } = process.env;
@@ -27,7 +27,7 @@ module.exports = class GithubCommand extends Command {
try { try {
const { body } = await snekfetch const { body } = await snekfetch
.get(`https://${GITHUB_LOGIN}@api.github.com/repos/${repo}`); .get(`https://${GITHUB_LOGIN}@api.github.com/repos/${repo}`);
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xFFFFFF) .setColor(0xFFFFFF)
.setAuthor('Github', 'https://i.imgur.com/ajcPgJG.png') .setAuthor('Github', 'https://i.imgur.com/ajcPgJG.png')
.setURL(body.html_url) .setURL(body.html_url)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { cleanXML } = require('../../structures/Util'); const { cleanXML } = require('../../structures/Util');
const { promisifyAll } = require('tsubaki'); const { promisifyAll } = require('tsubaki');
@@ -32,7 +32,7 @@ module.exports = class MangaCommand extends Command {
.query({ q: query }); .query({ q: query });
const { manga } = await xml.parseStringAsync(text); const { manga } = await xml.parseStringAsync(text);
const synopsis = cleanXML(manga.entry[0].synopsis[0].substr(0, 2000)); const synopsis = cleanXML(manga.entry[0].synopsis[0].substr(0, 2000));
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x2D54A2) .setColor(0x2D54A2)
.setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png') .setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png')
.setURL(`https://myanimelist.net/manga/${manga.entry[0].id[0]}`) .setURL(`https://myanimelist.net/manga/${manga.entry[0].id[0]}`)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { OSU_KEY } = process.env; const { OSU_KEY } = process.env;
@@ -31,7 +31,7 @@ module.exports = class OsuCommand extends Command {
type: 'string' type: 'string'
}); });
if (!body.length) return msg.say('No Results.'); if (!body.length) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xFF66AA) .setColor(0xFF66AA)
.setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png') .setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png')
.setURL('https://osu.ppy.sh/') .setURL('https://osu.ppy.sh/')
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class RecipeCommand extends Command { module.exports = class RecipeCommand extends Command {
@@ -28,7 +28,7 @@ module.exports = class RecipeCommand extends Command {
const body = JSON.parse(text); const body = JSON.parse(text);
if (!body.results.length) return msg.say('No Results.'); if (!body.results.length) return msg.say('No Results.');
const recipe = body.results[Math.floor(Math.random() * body.results.length)]; const recipe = body.results[Math.floor(Math.random() * body.results.length)];
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xC20000) .setColor(0xC20000)
.setURL(recipe.href) .setURL(recipe.href)
.setTitle(recipe.title) .setTitle(recipe.title)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { SOUNDCLOUD_KEY } = process.env; const { SOUNDCLOUD_KEY } = process.env;
@@ -30,7 +30,7 @@ module.exports = class SoundCloudCommand extends Command {
client_id: SOUNDCLOUD_KEY client_id: SOUNDCLOUD_KEY
}); });
if (!body.length) return msg.say('No Results.'); if (!body.length) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xF15A22) .setColor(0xF15A22)
.setAuthor('SoundCloud', 'https://i.imgur.com/lFIz7RU.png') .setAuthor('SoundCloud', 'https://i.imgur.com/lFIz7RU.png')
.setTitle(body[0].title) .setTitle(body[0].title)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class UrbanCommand extends Command { module.exports = class UrbanCommand extends Command {
@@ -26,7 +26,7 @@ module.exports = class UrbanCommand extends Command {
.get('http://api.urbandictionary.com/v0/define') .get('http://api.urbandictionary.com/v0/define')
.query({ term: query }); .query({ term: query });
if (!body.list.length) return msg.say('No Results.'); if (!body.list.length) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x32A8F0) .setColor(0x32A8F0)
.setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png') .setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png')
.setURL(body.list[0].permalink) .setURL(body.list[0].permalink)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const moment = require('moment'); const moment = require('moment');
const { WATTPAD_KEY } = process.env; const { WATTPAD_KEY } = process.env;
@@ -32,7 +32,7 @@ module.exports = class WattpadCommand extends Command {
}) })
.set({ Authorization: `Basic ${WATTPAD_KEY}` }); .set({ Authorization: `Basic ${WATTPAD_KEY}` });
if (!body.stories.length) return msg.say('No Results.'); if (!body.stories.length) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xF89C34) .setColor(0xF89C34)
.setAuthor('Wattpad', 'https://i.imgur.com/Rw9vRQB.png') .setAuthor('Wattpad', 'https://i.imgur.com/Rw9vRQB.png')
.setURL(body.stories[0].url) .setURL(body.stories[0].url)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class WeatherCommand extends Command { module.exports = class WeatherCommand extends Command {
@@ -29,7 +29,7 @@ module.exports = class WeatherCommand extends Command {
format: 'json' format: 'json'
}); });
if (!body.query.count) return msg.say('Location Not Found.'); if (!body.query.count) return msg.say('Location Not Found.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x0000FF) .setColor(0x0000FF)
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png') .setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
.setURL(body.query.results.channel.link) .setURL(body.query.results.channel.link)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class WikipediaCommand extends Command { module.exports = class WikipediaCommand extends Command {
@@ -35,7 +35,7 @@ module.exports = class WikipediaCommand extends Command {
formatversion: 2 formatversion: 2
}); });
if (body.query.pages[0].missing) return msg.say('No Results.'); if (body.query.pages[0].missing) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xE7E7E7) .setColor(0xE7E7E7)
.setTitle(body.query.pages[0].title) .setTitle(body.query.pages[0].title)
.setAuthor('Wikipedia', 'https://i.imgur.com/a4eeEhh.png') .setAuthor('Wikipedia', 'https://i.imgur.com/a4eeEhh.png')
+4 -4
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class XKCDCommand extends Command { module.exports = class XKCDCommand extends Command {
@@ -28,7 +28,7 @@ module.exports = class XKCDCommand extends Command {
const current = await snekfetch const current = await snekfetch
.get('https://xkcd.com/info.0.json'); .get('https://xkcd.com/info.0.json');
if (type === 'today') { if (type === 'today') {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`${current.body.num} - ${current.body.title}`) .setTitle(`${current.body.num} - ${current.body.title}`)
.setURL(`https://xkcd.com/${current.body.num}`) .setURL(`https://xkcd.com/${current.body.num}`)
.setImage(current.body.img) .setImage(current.body.img)
@@ -38,7 +38,7 @@ module.exports = class XKCDCommand extends Command {
const random = Math.floor(Math.random() * current.body.num) + 1; const random = Math.floor(Math.random() * current.body.num) + 1;
const { body } = await snekfetch const { body } = await snekfetch
.get(`https://xkcd.com/${random}/info.0.json`); .get(`https://xkcd.com/${random}/info.0.json`);
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`${body.num} - ${body.title}`) .setTitle(`${body.num} - ${body.title}`)
.setURL(`https://xkcd.com/${body.num}`) .setURL(`https://xkcd.com/${body.num}`)
.setImage(body.img) .setImage(body.img)
@@ -49,7 +49,7 @@ module.exports = class XKCDCommand extends Command {
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid Number.'); if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid Number.');
const { body } = await snekfetch const { body } = await snekfetch
.get(`https://xkcd.com/${choice}/info.0.json`); .get(`https://xkcd.com/${choice}/info.0.json`);
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`${body.num} - ${body.title}`) .setTitle(`${body.num} - ${body.title}`)
.setURL(`https://xkcd.com/${body.num}`) .setURL(`https://xkcd.com/${body.num}`)
.setImage(body.img) .setImage(body.img)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { GOOGLE_KEY } = process.env; const { GOOGLE_KEY } = process.env;
@@ -33,7 +33,7 @@ module.exports = class YouTubeCommand extends Command {
key: GOOGLE_KEY key: GOOGLE_KEY
}); });
if (!body.items.length) return msg.say('No Results.'); if (!body.items.length) return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xDD2825) .setColor(0xDD2825)
.setTitle(body.items[0].snippet.title) .setTitle(body.items[0].snippet.title)
.setDescription(body.items[0].snippet.description) .setDescription(body.items[0].snippet.description)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
module.exports = class YuGiOhCommand extends Command { module.exports = class YuGiOhCommand extends Command {
@@ -26,7 +26,7 @@ module.exports = class YuGiOhCommand extends Command {
const { body } = await snekfetch const { body } = await snekfetch
.get(`http://yugiohprices.com/api/card_data/${query}`); .get(`http://yugiohprices.com/api/card_data/${query}`);
if (body.status === 'fail') return msg.say('No Results.'); if (body.status === 'fail') return msg.say('No Results.');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0xBE5F1F) .setColor(0xBE5F1F)
.setTitle(body.data.name) .setTitle(body.data.name)
.setDescription(body.data.text) .setDescription(body.data.text)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
module.exports = class EmbedCommand extends Command { module.exports = class EmbedCommand extends Command {
constructor(client) { constructor(client) {
@@ -21,7 +21,7 @@ module.exports = class EmbedCommand extends Command {
run(msg, args) { run(msg, args) {
const { text } = args; const { text } = args;
const embed = new RichEmbed() const embed = new MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL) .setAuthor(msg.author.tag, msg.author.displayAvatarURL)
.setColor(0x00AE86) .setColor(0x00AE86)
.setTimestamp() .setTimestamp()
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const codes = require('../../assets/json/translate'); const codes = require('../../assets/json/translate');
const { YANDEX_KEY } = process.env; const { YANDEX_KEY } = process.env;
@@ -58,7 +58,7 @@ module.exports = class TranslateCommand extends Command {
lang: from ? `${from}-${to}` : to lang: from ? `${from}-${to}` : to
}); });
const lang = body.lang.split('-'); const lang = body.lang.split('-');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.addField(` From: ${codes[lang[0]]}`, .addField(` From: ${codes[lang[0]]}`,
text) text)
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const moment = require('moment'); const moment = require('moment');
const statuses = require('../../assets/json/user-info'); const statuses = require('../../assets/json/user-info');
@@ -27,7 +27,7 @@ module.exports = class UserInfoCommand extends Command {
run(msg, args) { run(msg, args) {
const member = args.member || msg.member; const member = args.member || msg.member;
const status = member.user.presence.status; const status = member.user.presence.status;
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(member.displayHexColor) .setColor(member.displayHexColor)
.setThumbnail(member.user.displayAvatarURL()) .setThumbnail(member.user.displayAvatarURL())
.addField(' Name', .addField(' Name',
+3 -3
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags'); const { stripIndents } = require('common-tags');
module.exports = class HelpCommand extends Command { module.exports = class HelpCommand extends Command {
@@ -29,7 +29,7 @@ module.exports = class HelpCommand extends Command {
const showAll = command && command.toLowerCase() === 'all'; const showAll = command && command.toLowerCase() === 'all';
if (command && !showAll) { if (command && !showAll) {
if (commands.length === 1) { if (commands.length === 1) {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`Command ${commands[0].name}`) .setTitle(`Command ${commands[0].name}`)
.setDescription(stripIndents` .setDescription(stripIndents`
${commands[0].description} ${commands[0].description}
@@ -48,7 +48,7 @@ module.exports = class HelpCommand extends Command {
return msg.say(`Could not identify command. Use ${msg.usage(null)} to view a list of commands.`); return msg.say(`Could not identify command. Use ${msg.usage(null)} to view a list of commands.`);
} }
} else { } else {
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(!showAll ? `Commands Available in ${msg.guild ? msg.guild.name : 'this DM'}` : 'All Commands') .setTitle(!showAll ? `Commands Available in ${msg.guild ? msg.guild.name : 'this DM'}` : 'All Commands')
.setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`) .setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`)
.setColor(0x00AE86); .setColor(0x00AE86);
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { version } = require('../../package'); const { version } = require('../../package');
const moment = require('moment'); const moment = require('moment');
require('moment-duration-format'); require('moment-duration-format');
@@ -20,7 +20,7 @@ module.exports = class InfoCommand extends Command {
async run(msg) { async run(msg) {
const guilds = await this.client.shard.fetchClientValues('guilds.size'); const guilds = await this.client.shard.fetchClientValues('guilds.size');
const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed'); const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.setFooter('©2017 dragonfire535#8081') .setFooter('©2017 dragonfire535#8081')
.addField(' Servers', .addField(' Servers',
+2 -2
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command'); const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const moment = require('moment'); const moment = require('moment');
require('moment-duration-format'); require('moment-duration-format');
@@ -32,7 +32,7 @@ module.exports = class ShardInfoCommand extends Command {
const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed'); const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed');
const uptime = await this.client.shard.fetchClientValues('uptime'); const uptime = await this.client.shard.fetchClientValues('uptime');
const guilds = await this.client.shard.fetchClientValues('guilds.size'); const guilds = await this.client.shard.fetchClientValues('guilds.size');
const embed = new RichEmbed() const embed = new MessageEmbed()
.setTitle(`Shard ${shard}`) .setTitle(`Shard ${shard}`)
.setColor(0x00AE86) .setColor(0x00AE86)
.addField(' Servers', .addField(' Servers',
+1 -1
View File
@@ -14,7 +14,7 @@
<ol> <ol>
<li>Avatar image Editing, including Bob Ross, RIP, Wanted, Triggered, Steam Card, and more!</li> <li>Avatar image Editing, including Bob Ross, RIP, Wanted, Triggered, Steam Card, and more!</li>
<li>Profile Trading Cards, with random rarity!</li> <li>Profile Trading Cards, with random rarity!</li>
<li>Battle! Challenge your friends in real turn-based matches!</li> <li>Battle! Challenge your friends or the AI in real turn-based matches!</li>
<li>Fun Games including Hangman, Lottery, Math, Quiz, Rock Paper Scissors, Slots, and Typing!</li> <li>Fun Games including Hangman, Lottery, Math, Quiz, Rock Paper Scissors, Slots, and Typing!</li>
<li>Server and User Information!</li> <li>Server and User Information!</li>
<li>Minecraft Achievement Generation!</li> <li>Minecraft Achievement Generation!</li>
+1 -1
View File
@@ -11,7 +11,7 @@
<ol> <ol>
<li>Avatar image Editing, including Bob Ross, RIP, Wanted, Triggered, Steam Card, and more!</li> <li>Avatar image Editing, including Bob Ross, RIP, Wanted, Triggered, Steam Card, and more!</li>
<li>Profile Trading Cards, with random rarity!</li> <li>Profile Trading Cards, with random rarity!</li>
<li>Battle! Challenge your friends in real turn-based matches!</li> <li>Battle! Challenge your friends or the AI in real turn-based matches!</li>
<li>Fun Games including Hangman, Lottery, Math, Quiz, Rock Paper Scissors, Slots, and Typing!</li> <li>Fun Games including Hangman, Lottery, Math, Quiz, Rock Paper Scissors, Slots, and Typing!</li>
<li>Server and User Information!</li> <li>Server and User Information!</li>
<li>Minecraft Achievement Generation!</li> <li>Minecraft Achievement Generation!</li>
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiaobot", "name": "xiaobot",
"version": "26.2.0", "version": "26.2.1",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Shard.js", "main": "Shard.js",
"scripts": { "scripts": {
@@ -28,7 +28,7 @@
}, },
"homepage": "https://github.com/dragonfire535/xiaobot#readme", "homepage": "https://github.com/dragonfire535/xiaobot#readme",
"engines": { "engines": {
"node": "8.1.2" "node": "8.1.3"
}, },
"dependencies": { "dependencies": {
"bufferutil": "^3.0.1", "bufferutil": "^3.0.1",