Embed style, better yugioh api

This commit is contained in:
Daniel Odendahl Jr
2018-04-20 13:15:38 +00:00
parent a880d2578b
commit 116582e6a8
35 changed files with 207 additions and 384 deletions
+3 -6
View File
@@ -34,12 +34,9 @@ module.exports = class HoroscopeCommand extends Command {
.setURL(`https://new.theastrologer.com/${body.sunsign}/`) .setURL(`https://new.theastrologer.com/${body.sunsign}/`)
.setTimestamp() .setTimestamp()
.setDescription(body.horoscope) .setDescription(body.horoscope)
.addField(' Mood', .addField(' Mood', body.meta.mood, true)
body.meta.mood, true) .addField(' Intensity', body.meta.intensity, true)
.addField(' Intensity', .addField(' Date', body.date, true);
body.meta.intensity, true)
.addField(' Date',
body.date, true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+7 -14
View File
@@ -32,20 +32,13 @@ module.exports = class ChannelInfoCommand extends Command {
run(msg, { channel }) { run(msg, { channel }) {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.addField(' Name', .addField(' Name', channel.type === 'dm' ? `@${channel.recipient.username}` : channel.name, true)
channel.type === 'dm' ? `@${channel.recipient.username}` : channel.name, true) .addField(' ID', channel.id, true)
.addField(' ID', .addField(' NSFW', channel.nsfw ? 'Yes' : 'No', true)
channel.id, true) .addField(' Category', channel.parent ? channel.parent.name : 'None', true)
.addField(' NSFW', .addField(' Type', types[channel.type], true)
channel.nsfw ? 'Yes' : 'No', true) .addField(' Creation Date', channel.createdAt.toDateString(), true)
.addField(' Category', .addField(' Topic', channel.topic || 'None');
channel.parent ? channel.parent.name : 'None', true)
.addField(' Type',
types[channel.type], true)
.addField(' Creation Date',
channel.createdAt.toDateString(), true)
.addField(' Topic',
channel.topic || 'None');
return msg.embed(embed); return msg.embed(embed);
} }
}; };
+4 -8
View File
@@ -25,14 +25,10 @@ module.exports = class EmojiInfoCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.setThumbnail(emoji.url) .setThumbnail(emoji.url)
.addField(' Name', .addField(' Name', emoji.name, true)
emoji.name, true) .addField(' ID', emoji.id, true)
.addField(' ID', .addField(' Creation Date', emoji.createdAt.toDateString(), true)
emoji.id, true) .addField(' Animated?', emoji.animated ? 'Yes' : 'No', true);
.addField(' Creation Date',
emoji.createdAt.toDateString(), true)
.addField(' Animated?',
emoji.animated ? 'Yes' : 'No', true);
return msg.embed(embed); return msg.embed(embed);
} }
}; };
+7 -14
View File
@@ -27,20 +27,13 @@ module.exports = class RoleInfoCommand extends Command {
const perms = Object.keys(permissions).filter(perm => serialized[perm]); const perms = Object.keys(permissions).filter(perm => serialized[perm]);
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(role.hexColor) .setColor(role.hexColor)
.addField(' Name', .addField(' Name', role.name, true)
role.name, true) .addField(' ID', role.id, true)
.addField(' ID', .addField(' Color', role.hexColor.toUpperCase(), true)
role.id, true) .addField(' Creation Date', role.createdAt.toDateString(), true)
.addField(' Color', .addField(' Hoisted?', role.hoist ? 'Yes' : 'No', true)
role.hexColor.toUpperCase(), true) .addField(' Mentionable?', role.mentionable ? 'Yes' : 'No', true)
.addField(' Creation Date', .addField(' Permissions', perms.map(perm => permissions[perm]).join(', ') || 'None');
role.createdAt.toDateString(), true)
.addField(' Hoisted?',
role.hoist ? 'Yes' : 'No', true)
.addField(' Mentionable?',
role.mentionable ? 'Yes' : 'No', true)
.addField(' Permissions',
perms.map(perm => permissions[perm]).join(', ') || 'None');
return msg.embed(embed); return msg.embed(embed);
} }
}; };
+10 -20
View File
@@ -21,26 +21,16 @@ module.exports = class ServerInfoCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.setThumbnail(msg.guild.iconURL()) .setThumbnail(msg.guild.iconURL())
.addField(' Name', .addField(' Name', msg.guild.name, true)
msg.guild.name, true) .addField(' ID', msg.guild.id, true)
.addField(' ID', .addField(' Region', msg.guild.region.toUpperCase(), true)
msg.guild.id, true) .addField(' Creation Date', msg.guild.createdAt.toDateString(), true)
.addField(' Region', .addField(' Explicit Filter', filterLevels[msg.guild.explicitContentFilter], true)
msg.guild.region.toUpperCase(), true) .addField(' Verification Level', verificationLevels[msg.guild.verificationLevel], true)
.addField(' Creation Date', .addField(' Owner', msg.guild.owner.user.tag, true)
msg.guild.createdAt.toDateString(), true) .addField(' Members', msg.guild.memberCount, true)
.addField(' Explicit Filter', .addField(' Roles', msg.guild.roles.size, true)
filterLevels[msg.guild.explicitContentFilter], true) .addField(' Channels', msg.guild.channels.size, true);
.addField(' Verification Level',
verificationLevels[msg.guild.verificationLevel], true)
.addField(' Owner',
msg.guild.owner.user.tag, true)
.addField(' Members',
msg.guild.memberCount, true)
.addField(' Roles',
msg.guild.roles.size, true)
.addField(' Channels',
msg.guild.channels.size, true);
return msg.embed(embed); return msg.embed(embed);
} }
}; };
+7 -14
View File
@@ -27,22 +27,15 @@ module.exports = class UserInfoCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(member.displayHexColor) .setColor(member.displayHexColor)
.setThumbnail(member.user.displayAvatarURL()) .setThumbnail(member.user.displayAvatarURL())
.addField(' Name', .addField(' Name', member.user.tag, true)
member.user.tag, true) .addField(' ID', member.id, true)
.addField(' ID', .addField(' Discord Join Date', member.user.createdAt.toDateString(), true)
member.id, true) .addField(' Server Join Date', member.joinedAt.toDateString(), true)
.addField(' Discord Join Date', .addField(' Nickname', member.nickname || 'None', true)
member.user.createdAt.toDateString(), true) .addField(' Bot?', member.user.bot ? 'Yes' : 'No', true)
.addField(' Server Join Date',
member.joinedAt.toDateString(), true)
.addField(' Nickname',
member.nickname || 'None', true)
.addField(' Bot?',
member.user.bot ? 'Yes' : 'No', true)
.addField(' Highest Role', .addField(' Highest Role',
member.roles.highest.id !== msg.guild.defaultRole.id ? member.roles.highest.name : 'None', true) member.roles.highest.id !== msg.guild.defaultRole.id ? member.roles.highest.name : 'None', true)
.addField(' Hoist Role', .addField(' Hoist Role', member.roles.hoist ? member.roles.hoist.name : 'None', true);
member.roles.hoist ? member.roles.hoist.name : 'None', true);
return msg.embed(embed); return msg.embed(embed);
} }
}; };
+1 -2
View File
@@ -42,8 +42,7 @@ module.exports = class NewYorkTimesCommand extends Command {
.setURL(data.web_url) .setURL(data.web_url)
.setTitle(data.headline.main) .setTitle(data.headline.main)
.setDescription(shorten(data.snippet)) .setDescription(shorten(data.snippet))
.addField(' Publish Date', .addField(' Publish Date', new Date(data.pub_date).toDateString(), true);
new Date(data.pub_date).toDateString(), true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+5 -6
View File
@@ -40,12 +40,11 @@ module.exports = class ForecastCommand extends Command {
.setTimestamp(); .setTimestamp();
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const forecast = data.item.forecast[i]; const forecast = data.item.forecast[i];
embed.addField(` ${forecast.day} - ${forecast.date}`, embed.addField(` ${forecast.day} - ${forecast.date}`, stripIndents`
stripIndents` **High**: ${forecast.high}°F
**High**: ${forecast.high}°F **Low**: ${forecast.low}°F
**Low**: ${forecast.low}°F **Condition**: ${forecast.text}
**Condition**: ${forecast.text} `);
`);
} }
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
+6 -12
View File
@@ -42,18 +42,12 @@ module.exports = class GitHubCommand extends Command {
.setURL(body.html_url) .setURL(body.html_url)
.setDescription(body.description ? shorten(body.description) : 'No description.') .setDescription(body.description ? shorten(body.description) : 'No description.')
.setThumbnail(body.owner.avatar_url) .setThumbnail(body.owner.avatar_url)
.addField(' Stars', .addField(' Stars', body.stargazers_count, true)
body.stargazers_count, true) .addField(' Forks', body.forks, true)
.addField(' Forks', .addField(' Issues', body.open_issues, true)
body.forks, true) .addField(' Language', body.language || '???', true)
.addField(' Issues', .addField(' Creation Date', new Date(body.created_at).toDateString(), true)
body.open_issues, true) .addField(' Modification Date', new Date(body.updated_at).toDateString(), true);
.addField(' Language',
body.language || '???', true)
.addField(' Creation Date',
new Date(body.created_at).toDateString(), true)
.addField(' Modification Date',
new Date(body.updated_at).toDateString(), true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.status === 404) return msg.say('Could not find any results.'); if (err.status === 404) return msg.say('Could not find any results.');
+4 -8
View File
@@ -42,14 +42,10 @@ module.exports = class GoogleBookCommand extends Command {
.setAuthor('Google Books', 'https://i.imgur.com/N3oHABo.png', 'https://books.google.com/') .setAuthor('Google Books', 'https://i.imgur.com/N3oHABo.png', 'https://books.google.com/')
.setDescription(data.description ? shorten(data.description) : 'No description available.') .setDescription(data.description ? shorten(data.description) : 'No description available.')
.setThumbnail(data.imageLinks ? data.imageLinks.thumbnail : null) .setThumbnail(data.imageLinks ? data.imageLinks.thumbnail : null)
.addField(' Authors', .addField(' Authors', data.authors.length ? data.authors.join(', ') : '???')
data.authors.length ? data.authors.join(', ') : '???') .addField(' Publish Date', data.publishedDate || '???', true)
.addField(' Publish Date', .addField(' Page Count', data.pageCount || '???', true)
data.publishedDate || '???', true) .addField(' Genres', data.categories.length ? data.categories.join(', ') : '???');
.addField(' Page Count',
data.pageCount || '???', true)
.addField(' Genres',
data.categories.length ? data.categories.join(', ') : '???');
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+4 -8
View File
@@ -49,14 +49,10 @@ module.exports = class ITunesCommand extends Command {
.setURL(data.trackViewUrl) .setURL(data.trackViewUrl)
.setThumbnail(data.artworkUrl100) .setThumbnail(data.artworkUrl100)
.setTitle(data.trackName) .setTitle(data.trackName)
.addField(' Artist', .addField(' Artist', data.artistName, true)
data.artistName, true) .addField(' Album', data.collectionName, true)
.addField(' Album', .addField(' Release Date', new Date(data.releaseDate).toDateString(), true)
data.collectionName, true) .addField(' Genre', data.primaryGenreName, true);
.addField(' Release Date',
new Date(data.releaseDate).toDateString(), true)
.addField(' Genre',
data.primaryGenreName, true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.status === 400) { if (err.status === 400) {
+6 -12
View File
@@ -39,18 +39,12 @@ module.exports = class KickstarterCommand extends Command {
.setAuthor('Kickstarter', 'https://i.imgur.com/EHDlH5t.png', 'https://www.kickstarter.com/') .setAuthor('Kickstarter', 'https://i.imgur.com/EHDlH5t.png', 'https://www.kickstarter.com/')
.setDescription(shorten(data.blurb)) .setDescription(shorten(data.blurb))
.setThumbnail(data.photo ? data.photo.full : null) .setThumbnail(data.photo ? data.photo.full : null)
.addField(' Goal', .addField(' Goal', `$${data.goal}`, true)
`$${data.goal}`, true) .addField(' Pledged', `$${data.pledged}`, true)
.addField(' Pledged', .addField(' Backers', data.backers_count, true)
`$${data.pledged}`, true) .addField(' Creator', data.creator.name, true)
.addField(' Backers', .addField(' Creation Date', new Date(data.created_at * 1000).toDateString(), true)
data.backers_count, true) .addField(' Deadline', new Date(data.deadline * 1000).toDateString(), true);
.addField(' Creator',
data.creator.name, true)
.addField(' Creation Date',
new Date(data.created_at * 1000).toDateString(), true)
.addField(' Deadline',
new Date(data.deadline * 1000).toDateString(), true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+17 -34
View File
@@ -40,42 +40,25 @@ module.exports = class LeagueOfLegendsChampionCommand extends Command {
.setTitle(`${data.name} ${data.title}`) .setTitle(`${data.name} ${data.title}`)
.setDescription(data.blurb) .setDescription(data.blurb)
.setThumbnail(`https://ddragon.leagueoflegends.com/cdn/${this.version}/img/champion/${data.image.full}`) .setThumbnail(`https://ddragon.leagueoflegends.com/cdn/${this.version}/img/champion/${data.image.full}`)
.addField(' Attack', .addField(' Attack', data.info.attack, true)
data.info.attack, true) .addField(' Defense', data.info.defense, true)
.addField(' Defense', .addField(' Magic', data.info.magic, true)
data.info.defense, true) .addField(' Difficulty', data.info.difficulty, true)
.addField(' Magic', .addField(' HP', `${data.stats.hp} (${data.stats.hpperlevel}/level)`, true)
data.info.magic, true) .addField(' HP Regen', `${data.stats.hpregen} (${data.stats.hpregenperlevel}/level)`, true)
.addField(' Difficulty', .addField(' MP', `${data.stats.mp} (${data.stats.mpperlevel}/level)`, true)
data.info.difficulty, true) .addField(' MP Regen', `${data.stats.mpregen} (${data.stats.mpregenperlevel}/level)`, true)
.addField(' HP', .addField(' Resource', data.partype, true)
`${data.stats.hp} (${data.stats.hpperlevel}/level)`, true) .addField(' Armor', `${data.stats.armor} (${data.stats.armorperlevel}/level)`, true)
.addField(' HP Regen', .addField(' Attack Damage', `${data.stats.attackdamage} (${data.stats.attackdamageperlevel}/level)`, true)
`${data.stats.hpregen} (${data.stats.hpregenperlevel}/level)`, true) .addField(' Attack Range', data.stats.attackrange, true)
.addField(' MP',
`${data.stats.mp} (${data.stats.mpperlevel}/level)`, true)
.addField(' MP Regen',
`${data.stats.mpregen} (${data.stats.mpregenperlevel}/level)`, true)
.addField(' Resource',
data.partype, true)
.addField(' Armor',
`${data.stats.armor} (${data.stats.armorperlevel}/level)`, true)
.addField(' Attack Damage',
`${data.stats.attackdamage} (${data.stats.attackdamageperlevel}/level)`, true)
.addField(' Attack Range',
data.stats.attackrange, true)
.addField(' Attack Speed Offset', .addField(' Attack Speed Offset',
`${data.stats.attackspeedoffset} (${data.stats.attackspeedperlevel}/level)`, true) `${data.stats.attackspeedoffset} (${data.stats.attackspeedperlevel}/level)`, true)
.addField(' Crit', .addField(' Crit', `${data.stats.crit} (${data.stats.critperlevel}/level)`, true)
`${data.stats.crit} (${data.stats.critperlevel}/level)`, true) .addField(' Move Speed', data.stats.movespeed, true)
.addField(' Move Speed', .addField(' Spell Block', `${data.stats.spellblock} (${data.stats.spellblockperlevel}/level)`, true)
data.stats.movespeed, true) .addField(' Passive', data.passive.name, true)
.addField(' Spell Block', .addField(' Spells', data.spells.map((spell, i) => `${spell.name} (${buttons[i]})`).join('\n'), true);
`${data.stats.spellblock} (${data.stats.spellblockperlevel}/level)`, true)
.addField(' Passive',
data.passive.name, true)
.addField(' Spells',
data.spells.map((spell, i) => `${spell.name} (${buttons[i]})`).join('\n'), true);
return msg.say(`Tip: ${tips[Math.floor(Math.random() * tips.length)]}`, { embed }); return msg.say(`Tip: ${tips[Math.floor(Math.random() * tips.length)]}`, { embed });
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+4 -8
View File
@@ -41,14 +41,10 @@ module.exports = class MyAnimeListAnimeCommand extends Command {
.setThumbnail(data.image[0]) .setThumbnail(data.image[0])
.setTitle(data.title[0]) .setTitle(data.title[0])
.setDescription(shorten(cleanXML(data.synopsis[0]))) .setDescription(shorten(cleanXML(data.synopsis[0])))
.addField(' Type', .addField(' Type', `${data.type[0]} - ${data.status[0]}`, true)
`${data.type[0]} - ${data.status[0]}`, true) .addField(' Episodes', data.episodes[0], true)
.addField(' Episodes', .addField(' Start Date', data.start_date[0] !== '0000-00-00' ? data.start_date[0] : '???', true)
data.episodes[0], true) .addField(' End Date', data.end_date[0] !== '0000-00-00' ? data.end_date[0] : '???', true);
.addField(' Start Date',
data.start_date[0] !== '0000-00-00' ? data.start_date[0] : '???', true)
.addField(' End Date',
data.end_date[0] !== '0000-00-00' ? data.end_date[0] : '???', true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.message === 'Parse Error') return msg.say('Could not find any results.'); if (err.message === 'Parse Error') return msg.say('Could not find any results.');
+3 -6
View File
@@ -41,14 +41,11 @@ module.exports = class MyAnimeListMangaCommand extends Command {
.setThumbnail(data.image[0]) .setThumbnail(data.image[0])
.setTitle(data.title[0]) .setTitle(data.title[0])
.setDescription(shorten(cleanXML(data.synopsis[0]))) .setDescription(shorten(cleanXML(data.synopsis[0])))
.addField(' Type', .addField(' Type', `${data.type[0]} - ${data.status[0]}`, true)
`${data.type[0]} - ${data.status[0]}`, true)
.addField(' Volumes / Chapters', .addField(' Volumes / Chapters',
`${Number.parseInt(data.volumes[0], 10) || '???'} / ${Number.parseInt(data.chapters[0], 10) || '???'}`, true) `${Number.parseInt(data.volumes[0], 10) || '???'} / ${Number.parseInt(data.chapters[0], 10) || '???'}`, true)
.addField(' Start Date', .addField(' Start Date', data.start_date[0] !== '0000-00-00' ? data.start_date[0] : '???', true)
data.start_date[0] !== '0000-00-00' ? data.start_date[0] : '???', true) .addField(' End Date', data.end_date[0] !== '0000-00-00' ? data.end_date[0] : '???', true);
.addField(' End Date',
data.end_date[0] !== '0000-00-00' ? data.end_date[0] : '???', true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.message === 'Parse Error') return msg.say('Could not find any results.'); if (err.message === 'Parse Error') return msg.say('Could not find any results.');
+1 -2
View File
@@ -32,8 +32,7 @@ module.exports = class NeopetItemCommand extends Command {
.setDescription(data.details) .setDescription(data.details)
.setURL(data.url) .setURL(data.url)
.setThumbnail(data.image) .setThumbnail(data.image)
.addField(' Price', .addField(' Price', data.price ? `${data.price} ${data.currency}` : 'Not for Sale');
data.price ? `${data.price} ${data.currency}` : 'Not for Sale');
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+8 -16
View File
@@ -37,22 +37,14 @@ module.exports = class NPMCommand extends Command {
.setTitle(body.name) .setTitle(body.name)
.setURL(`https://www.npmjs.com/package/${pkg}`) .setURL(`https://www.npmjs.com/package/${pkg}`)
.setDescription(body.description || 'No description.') .setDescription(body.description || 'No description.')
.addField(' Version', .addField(' Version', body['dist-tags'].latest, true)
body['dist-tags'].latest, true) .addField(' License', body.license || 'None', true)
.addField(' License', .addField(' Author', body.author ? body.author.name : '???', true)
body.license || 'None', true) .addField(' Creation Date', new Date(body.time.created).toDateString(), true)
.addField(' Author', .addField(' Modification Date', new Date(body.time.modified).toDateString(), true)
body.author ? body.author.name : 'Unknown', true) .addField(' Main File', version.main || 'index.js', true)
.addField(' Creation Date', .addField(' Dependencies', dependencies && dependencies.length ? dependencies.join(', ') : 'None')
new Date(body.time.created).toDateString(), true) .addField(' Maintainers', maintainers.join(', '));
.addField(' Modification Date',
new Date(body.time.modified).toDateString(), true)
.addField(' Main File',
version.main || 'index.js', true)
.addField(' Dependencies',
dependencies && dependencies.length ? dependencies.join(', ') : 'None')
.addField(' Maintainers',
maintainers.join(', '));
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.status === 404) return msg.say('Could not find any results.'); if (err.status === 404) return msg.say('Could not find any results.');
+12 -24
View File
@@ -36,30 +36,18 @@ module.exports = class OsuCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(0xFF66AA) .setColor(0xFF66AA)
.setAuthor('osu!', 'https://i.imgur.com/hWrw2Sv.png', 'https://osu.ppy.sh/') .setAuthor('osu!', 'https://i.imgur.com/hWrw2Sv.png', 'https://osu.ppy.sh/')
.addField(' Username', .addField(' Username', data.username, true)
data.username, true) .addField(' ID', data.user_id, true)
.addField(' ID', .addField(' Level', data.level || '???', true)
data.user_id, true) .addField(' Accuracy', data.accuracy || '???', true)
.addField(' Level', .addField(' Rank', data.pp_rank || '???', true)
data.level || '???', true) .addField(' Play Count', data.playcount || '???', true)
.addField(' Accuracy', .addField(' Country', data.country || '???', true)
data.accuracy || '???', true) .addField(' Ranked Score', data.ranked_score || '???', true)
.addField(' Rank', .addField(' Total Score', data.total_score || '???', true)
data.pp_rank || '???', true) .addField(' SS', data.count_rank_ss || '???', true)
.addField(' Play Count', .addField(' S', data.count_rank_s || '???', true)
data.playcount || '???', true) .addField(' A', data.count_rank_a || '???', true);
.addField(' Country',
data.country || '???', true)
.addField(' Ranked Score',
data.ranked_score || '???', true)
.addField(' Total Score',
data.total_score || '???', true)
.addField(' SS',
data.count_rank_ss || '???', true)
.addField(' S',
data.count_rank_s || '???', true)
.addField(' A',
data.count_rank_a || '???', true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+2 -4
View File
@@ -44,10 +44,8 @@ module.exports = class RottenTomatoesCommand extends Command {
.setAuthor('Rotten Tomatoes', 'https://i.imgur.com/Sru8mZ3.jpg', 'https://www.rottentomatoes.com/') .setAuthor('Rotten Tomatoes', 'https://i.imgur.com/Sru8mZ3.jpg', 'https://www.rottentomatoes.com/')
.setDescription(shorten(body.ratingSummary.consensus)) .setDescription(shorten(body.ratingSummary.consensus))
.setThumbnail(body.posters.original) .setThumbnail(body.posters.original)
.addField(' Critic Score', .addField(' Critic Score', criticScore.meterValue ? `${criticScore.meterValue}%` : '???', true)
criticScore.meterValue ? `${criticScore.meterValue}%` : '???', true) .addField(' Audience Score', audienceScore.meterScore ? `${audienceScore.meterScore}%` : '???', true);
.addField(' Audience Score',
audienceScore.meterScore ? `${audienceScore.meterScore}%` : '???', true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+6 -12
View File
@@ -43,18 +43,12 @@ module.exports = class StackOverflowCommand extends Command {
.setAuthor('Stack Overflow', 'https://i.imgur.com/P2jAgE3.png', 'https://stackoverflow.com/') .setAuthor('Stack Overflow', 'https://i.imgur.com/P2jAgE3.png', 'https://stackoverflow.com/')
.setURL(data.link) .setURL(data.link)
.setTitle(data.title) .setTitle(data.title)
.addField(' ID', .addField(' ID', data.question_id, true)
data.question_id, true) .addField(' Asker', `[${data.owner.display_name}](${data.owner.link})`, true)
.addField(' Asker', .addField(' Views', data.view_count, true)
`[${data.owner.display_name}](${data.owner.link})`, true) .addField(' Score', data.score, true)
.addField(' Views', .addField(' Creation Date', new Date(data.creation_date * 1000).toDateString(), true)
data.view_count, true) .addField(' Last Activity', new Date(data.last_activity_date * 1000).toDateString(), true);
.addField(' Score',
data.score, true)
.addField(' Creation Date',
new Date(data.creation_date * 1000).toDateString(), true)
.addField(' Last Activity',
new Date(data.last_activity_date * 1000).toDateString(), true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+8 -16
View File
@@ -51,22 +51,14 @@ module.exports = class SteamCommand extends Command {
.setTitle(data.name) .setTitle(data.name)
.setURL(`http://store.steampowered.com/app/${data.steam_appid}`) .setURL(`http://store.steampowered.com/app/${data.steam_appid}`)
.setThumbnail(tiny_image) .setThumbnail(tiny_image)
.addField(' Price', .addField(' Price', price, true)
price, true) .addField(' Metascore', data.metacritic ? data.metacritic.score : '???', true)
.addField(' Metascore', .addField(' Recommendations', data.recommendations ? data.recommendations.total : '???', true)
data.metacritic ? data.metacritic.score : '???', true) .addField(' Platforms', platforms.join(', ') || 'None', true)
.addField(' Recommendations', .addField(' Release Date', data.release_date ? data.release_date.date : '???', true)
data.recommendations ? data.recommendations.total : '???', true) .addField(' DLC Count', data.dlc ? data.dlc.length : 0, true)
.addField(' Platforms', .addField(' Developers', data.developers.join(', ') || '???')
platforms.join(', ') || 'None', true) .addField(' Publishers', data.publishers.join(', ') || '???');
.addField(' Release Date',
data.release_date ? data.release_date.date : '???', true)
.addField(' DLC Count',
data.dlc ? data.dlc.length : 0, true)
.addField(' Developers',
data.developers.join(', ') || '???')
.addField(' Publishers',
data.publishers.join(', ') || '???');
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+6 -12
View File
@@ -37,18 +37,12 @@ module.exports = class StocksCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle(`Stocks for ${symbol.toUpperCase()}`) .setTitle(`Stocks for ${symbol.toUpperCase()}`)
.setColor(0x9797FF) .setColor(0x9797FF)
.addField(' Open', .addField(' Open', `$${data['1. open']}`, true)
`$${data['1. open']}`, true) .addField(' Close', `$${data['4. close']}`, true)
.addField(' Close', .addField(' Volume', data['5. volume'], true)
`$${data['4. close']}`, true) .addField(' High', `$${data['2. high']}`, true)
.addField(' Volume', .addField(' Low', `$${data['3. low']}`, true)
data['5. volume'], true) .addField(' Last Updated', new Date(body['Meta Data']['3. Last Refreshed']).toDateString(), true);
.addField(' High',
`$${data['2. high']}`, true)
.addField(' Low',
`$${data['3. low']}`, true)
.addField(' Last Updated',
new Date(body['Meta Data']['3. Last Refreshed']).toDateString(), true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+3 -6
View File
@@ -43,12 +43,9 @@ module.exports = class TMDBMovieCommand extends Command {
.setAuthor('TMDB', 'https://i.imgur.com/3K3QMv9.png', 'https://www.themoviedb.org/') .setAuthor('TMDB', 'https://i.imgur.com/3K3QMv9.png', 'https://www.themoviedb.org/')
.setDescription(body.overview ? shorten(body.overview) : 'No description available.') .setDescription(body.overview ? shorten(body.overview) : 'No description available.')
.setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null) .setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null)
.addField(' Runtime', .addField(' Runtime', body.runtime ? `${body.runtime} mins.` : '???', true)
body.runtime ? `${body.runtime} mins.` : '???', true) .addField(' Release Date', body.release_date || '???', true)
.addField(' Release Date', .addField(' Genres', body.genres.length ? body.genres.map(genre => genre.name).join(', ') : '???')
body.release_date || '???', true)
.addField(' Genres',
body.genres.length ? body.genres.map(genre => genre.name).join(', ') : '???')
.addField(' Production Companies', .addField(' Production Companies',
body.production_companies.length ? body.production_companies.map(c => c.name).join(', ') : '???'); body.production_companies.length ? body.production_companies.map(c => c.name).join(', ') : '???');
return msg.embed(embed); return msg.embed(embed);
+5 -10
View File
@@ -43,16 +43,11 @@ module.exports = class TMDBTVShowCommand extends Command {
.setAuthor('TMDB', 'https://i.imgur.com/3K3QMv9.png', 'https://www.themoviedb.org/') .setAuthor('TMDB', 'https://i.imgur.com/3K3QMv9.png', 'https://www.themoviedb.org/')
.setDescription(body.overview ? shorten(body.overview) : 'No description available.') .setDescription(body.overview ? shorten(body.overview) : 'No description available.')
.setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null) .setThumbnail(body.poster_path ? `https://image.tmdb.org/t/p/w500${body.poster_path}` : null)
.addField(' First Air Date', .addField(' First Air Date', body.first_air_date || '???', true)
body.first_air_date || '???', true) .addField(' Last Air Date', body.last_air_date || '???', true)
.addField(' Last Air Date', .addField(' Seasons', body.number_of_seasons || '???', true)
body.last_air_date || '???', true) .addField(' Episodes', body.number_of_episodes || '???', true)
.addField(' Seasons', .addField(' Genres', body.genres.length ? body.genres.map(genre => genre.name).join(', ') : '???')
body.number_of_seasons || '???', true)
.addField(' Episodes',
body.number_of_episodes || '???', true)
.addField(' Genres',
body.genres.length ? body.genres.map(genre => genre.name).join(', ') : '???')
.addField(' Production Companies', .addField(' Production Companies',
body.production_companies.length ? body.production_companies.map(c => c.name).join(', ') : '???'); body.production_companies.length ? body.production_companies.map(c => c.name).join(', ') : '???');
return msg.embed(embed); return msg.embed(embed);
+2 -4
View File
@@ -35,10 +35,8 @@ module.exports = class TumblrCommand extends Command {
.setThumbnail(`https://api.tumblr.com/v2/blog/${blog}/avatar/512`) .setThumbnail(`https://api.tumblr.com/v2/blog/${blog}/avatar/512`)
.setURL(data.url) .setURL(data.url)
.setTitle(data.title) .setTitle(data.title)
.addField(' Posts', .addField(' Posts', data.total_posts, true)
data.total_posts, true) .addField(' A.M.A.?', data.ask ? 'Yes' : 'No', true);
.addField(' A.M.A.?',
data.ask ? 'Yes' : 'No', true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.status === 404) return msg.say('Could not find any results.'); if (err.status === 404) return msg.say('Could not find any results.');
+7 -14
View File
@@ -39,20 +39,13 @@ module.exports = class TwitterCommand extends Command {
.setURL(`https://twitter.com/${body.screen_name}`) .setURL(`https://twitter.com/${body.screen_name}`)
.setTitle(`${body.name} (@${body.screen_name})`) .setTitle(`${body.name} (@${body.screen_name})`)
.setDescription(body.description) .setDescription(body.description)
.addField(' Tweets', .addField(' Tweets', body.statuses_count, true)
body.statuses_count, true) .addField(' Followers', body.followers_count, true)
.addField(' Followers', .addField(' Following', body.friends_count, true)
body.followers_count, true) .addField(' Protected?', body.protected ? 'Yes' : 'No', true)
.addField(' Following', .addField(' Verified?', body.verified ? 'Yes' : 'No', true)
body.friends_count, true) .addField(' Creation Date', new Date(body.created_at).toDateString(), true)
.addField(' Protected?', .addField(' Latest Tweet', body.status ? body.status.text : '???');
body.protected ? 'Yes' : 'No', true)
.addField(' Verified?',
body.verified ? 'Yes' : 'No', true)
.addField(' Creation Date',
new Date(body.created_at).toDateString(), true)
.addField(' Latest Tweet',
body.status ? body.status.text : 'None');
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
if (err.status === 401) await this.fetchToken(); if (err.status === 401) await this.fetchToken();
+1 -2
View File
@@ -45,8 +45,7 @@ module.exports = class UrbanDictionaryCommand extends Command {
.setURL(data.permalink) .setURL(data.permalink)
.setTitle(data.word) .setTitle(data.word)
.setDescription(shorten(data.definition)) .setDescription(shorten(data.definition))
.addField(' Example', .addField(' Example', data.example ? shorten(data.example, 1000) : 'None');
data.example ? shorten(data.example, 1000) : 'None');
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+2 -4
View File
@@ -43,10 +43,8 @@ module.exports = class VocaloidCommand extends Command {
.setURL(`http://vocadb.net/S/${data.id}`) .setURL(`http://vocadb.net/S/${data.id}`)
.setDescription(data.lyrics.length ? shorten(data.lyrics[0].value) : 'No lyrics available.') .setDescription(data.lyrics.length ? shorten(data.lyrics[0].value) : 'No lyrics available.')
.setThumbnail(data.thumbUrl) .setThumbnail(data.thumbUrl)
.addField(' Artist', .addField(' Artist', data.artistString)
data.artistString) .addField(' Publish Date', new Date(data.publishDate).toDateString(), true);
.addField(' Publish Date',
new Date(data.publishDate).toDateString(), true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+6 -12
View File
@@ -41,18 +41,12 @@ module.exports = class WattpadCommand extends Command {
.setTitle(data.title) .setTitle(data.title)
.setDescription(shorten(data.description)) .setDescription(shorten(data.description))
.setThumbnail(data.cover) .setThumbnail(data.cover)
.addField(' Creation Date', .addField(' Creation Date', new Date(data.createDate).toDateString(), true)
new Date(data.createDate).toDateString(), true) .addField(' Author', data.user, true)
.addField(' Author', .addField(' Chapters', data.numParts, true)
data.user, true) .addField(' Reads', data.readCount, true)
.addField(' Chapters', .addField(' Votes', data.voteCount, true)
data.numParts, true) .addField(' Comments', data.commentCount, true);
.addField(' Reads',
data.readCount, true)
.addField(' Votes',
data.voteCount, true)
.addField(' Comments',
data.commentCount, true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+12 -24
View File
@@ -37,30 +37,18 @@ module.exports = class WeatherCommand extends Command {
.setAuthor(data.title, 'https://i.imgur.com/B9MMbtB.png', 'https://www.yahoo.com/news/weather') .setAuthor(data.title, 'https://i.imgur.com/B9MMbtB.png', 'https://www.yahoo.com/news/weather')
.setURL(data.link) .setURL(data.link)
.setTimestamp() .setTimestamp()
.addField(' City', .addField(' City', data.location.city, true)
data.location.city, true) .addField(' Country', data.location.country, true)
.addField(' Country', .addField(' Region', data.location.region, true)
data.location.country, true) .addField(' Condition', data.item.condition.text, true)
.addField(' Region', .addField(' Temperature', `${data.item.condition.temp}°F`, true)
data.location.region, true) .addField(' Humidity', data.atmosphere.humidity, true)
.addField(' Condition', .addField(' Pressure', data.atmosphere.pressure, true)
data.item.condition.text, true) .addField(' Rising', data.atmosphere.rising, true)
.addField(' Temperature', .addField(' Visibility', data.atmosphere.visibility, true)
`${data.item.condition.temp}°F`, true) .addField(' Wind Chill', data.wind.chill, true)
.addField(' Humidity', .addField(' Wind Direction', data.wind.direction, true)
data.atmosphere.humidity, true) .addField(' Wind Speed', data.wind.speed, true);
.addField(' Pressure',
data.atmosphere.pressure, true)
.addField(' Rising',
data.atmosphere.rising, true)
.addField(' Visibility',
data.atmosphere.visibility, true)
.addField(' Wind Chill',
data.wind.chill, true)
.addField(' Wind Direction',
data.wind.direction, true)
.addField(' Wind Speed',
data.wind.speed, true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+3 -6
View File
@@ -42,12 +42,9 @@ module.exports = class YouTubeCommand extends Command {
.setAuthor('YouTube', 'https://i.imgur.com/kKHJg9Q.png', 'https://www.youtube.com/') .setAuthor('YouTube', 'https://i.imgur.com/kKHJg9Q.png', 'https://www.youtube.com/')
.setURL(`https://www.youtube.com/watch?v=${data.id.videoId}`) .setURL(`https://www.youtube.com/watch?v=${data.id.videoId}`)
.setThumbnail(data.snippet.thumbnails.default ? data.snippet.thumbnails.default.url : null) .setThumbnail(data.snippet.thumbnails.default ? data.snippet.thumbnails.default.url : null)
.addField(' ID', .addField(' ID', data.id.videoId, true)
data.id.videoId, true) .addField(' Publish Date', new Date(data.snippet.publishedAt).toDateString(), true)
.addField(' Publish Date', .addField(' Channel', data.snippet.channelTitle, true);
new Date(data.snippet.publishedAt).toDateString(), true)
.addField(' Channel',
data.snippet.channelTitle, true);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+24 -23
View File
@@ -1,6 +1,7 @@
const { Command } = require('discord.js-commando'); const { Command } = require('discord.js-commando');
const { MessageEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch'); const snekfetch = require('snekfetch');
const { stripIndents } = require('common-tags');
const { shorten } = require('../../util/Util'); const { shorten } = require('../../util/Util');
module.exports = class YuGiOhCommand extends Command { module.exports = class YuGiOhCommand extends Command {
@@ -14,43 +15,43 @@ module.exports = class YuGiOhCommand extends Command {
clientPermissions: ['EMBED_LINKS'], clientPermissions: ['EMBED_LINKS'],
args: [ args: [
{ {
key: 'query', key: 'card',
prompt: 'What card would you like to get information on?', prompt: 'What card would you like to get information on?',
type: 'string', type: 'string'
parse: text => encodeURIComponent(text)
} }
] ]
}); });
} }
async run(msg, { query }) { async run(msg, { card }) {
try { try {
const { body } = await snekfetch.get(`https://yugiohprices.com/api/card_data/${query}`); const { text } = await snekfetch
if (body.status === 'fail') return msg.say('Could not find any results.'); .get('https://www.ygohub.com/api/card_info')
const image = await snekfetch.get(`https://yugiohprices.com/api/card_image/${query}`); .query({ name: card });
const { data } = body; const body = JSON.parse(text);
if (body.status === 'error') return msg.say('Could not find any results.');
const data = body.card;
const embed = new MessageEmbed() const embed = new MessageEmbed()
.attachFiles([{ attachment: image.body, name: 'thumbnail.jpg' }])
.setColor(0xBE5F1F) .setColor(0xBE5F1F)
.setTitle(data.name) .setTitle(data.name)
.setDescription(shorten(data.text)) .setDescription(shorten(data.text))
.setAuthor('Yu-Gi-Oh!', 'https://i.imgur.com/AJNBflD.png', 'http://www.yugioh-card.com/') .setAuthor('Yu-Gi-Oh!', 'https://i.imgur.com/AJNBflD.png', 'http://www.yugioh-card.com/')
.setThumbnail('attachment://thumbnail.jpg') .setURL(data.tcgplayer_link)
.addField(' Card Type', .setThumbnail(data.image_path)
data.card_type, true); .addField(' Card Type', data.type, true);
if (data.card_type === 'monster') { if (data.is_monster) {
embed embed
.addField(' Type', .addField(' Species', data.species, true)
data.type, true) .addField(' Attribute', data.attribute, true)
.addField(' Attribute', .addField(' Level', data.stars, true)
data.family, true) .addField(' ATK', data.attack, true)
.addField(' Level', .addField(' DEF', data.defense, true);
data.level, true)
.addField(' ATK',
data.atk, true)
.addField(' DEF',
data.def, true);
} }
embed.addField(' Legality', stripIndents`
TCG Advanced: ${data.legality.TCG.Advanced}
TCG Traditional: ${data.legality.TCG.Traditional}
OCG Advanced: ${data.legality.OCG.Advanced}
`);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+2 -4
View File
@@ -70,10 +70,8 @@ module.exports = class TranslateCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(0xFF0000) .setColor(0xFF0000)
.setFooter('Powered by Yandex.Translate', 'https://i.imgur.com/HMpH9sq.png') .setFooter('Powered by Yandex.Translate', 'https://i.imgur.com/HMpH9sq.png')
.addField(` From: ${codes[lang[0]]}`, .addField(` From: ${codes[lang[0]]}`, text)
text) .addField(` To: ${codes[lang[1]]}`, body.text[0]);
.addField(` To: ${codes[lang[1]]}`,
body.text[0]);
return msg.embed(embed); return msg.embed(embed);
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+8 -16
View File
@@ -20,22 +20,14 @@ module.exports = class InfoCommand extends Command {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.setFooter('©2017-2018 dragonfire535#8081') .setFooter('©2017-2018 dragonfire535#8081')
.addField(' Servers', .addField(' Servers', this.client.guilds.size, true)
this.client.guilds.size, true) .addField(' Shards', this.client.options.shardCount, true)
.addField(' Shards', .addField(' Commands', this.client.registry.commands.size, true)
this.client.options.shardCount, true) .addField(' Home Server', this.client.options.invite ? `[Here](${this.client.options.invite})` : 'None', true)
.addField(' Commands', .addField(' Memory Usage', `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
this.client.registry.commands.size, true) .addField(' Uptime', duration(this.client.uptime), true)
.addField(' Home Server', .addField(' Version', `v${version}`, true)
this.client.options.invite ? `[Here](${this.client.options.invite})` : 'None', true) .addField(' Node Version', process.version, true)
.addField(' Memory Usage',
`${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
.addField(' Uptime',
duration(this.client.uptime), true)
.addField(' Version',
`v${version}`, true)
.addField(' Node Version',
process.version, true)
.addField(' Library', .addField(' Library',
'[discord.js](https://discord.js.org)[-commando](https://github.com/discordjs/Commando)', true); '[discord.js](https://discord.js.org)[-commando](https://github.com/discordjs/Commando)', true);
return msg.embed(embed); return msg.embed(embed);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "72.0.4", "version": "72.0.5",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {