Lots of Changes

This commit is contained in:
Daniel Odendahl Jr
2017-08-26 01:20:43 +00:00
parent d2008c749d
commit 56e72f7509
78 changed files with 393 additions and 389 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class AnimeCommand extends Command {
anime.entry[0].end_date[0], true);
return msg.embed(embed);
} catch (err) {
if (err.message === 'Parse Error') return msg.say('No Results.');
if (err.message === 'Parse Error') return msg.say('Could not find any results.');
throw err;
}
}
+3 -3
View File
@@ -9,12 +9,12 @@ module.exports = class BotSearchCommand extends Command {
name: 'bot-info',
group: 'search',
memberName: 'bot-info',
description: 'Searches Discord Bots for info on a bot.',
description: 'Searches Discord Bots for information on a bot.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'bot',
prompt: 'Which bot do you want to get information for?',
prompt: 'Which bot do you want to get information on?',
type: 'user'
}
]
@@ -41,7 +41,7 @@ module.exports = class BotSearchCommand extends Command {
body.prefix, true);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Bot Not Found.');
if (err.status === 404) return msg.say('Could not find any results.');
throw err;
}
}
+2 -2
View File
@@ -15,7 +15,7 @@ module.exports = class BulbapediaCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What article would you like to search for?',
type: 'string'
}
]
@@ -36,7 +36,7 @@ module.exports = class BulbapediaCommand extends Command {
redirects: '',
formatversion: 2
});
if (body.query.pages[0].missing) return msg.say('No Results.');
if (body.query.pages[0].missing) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x3E7614)
.setTitle(body.query.pages[0].title)
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class DefineCommand extends Command {
useCanonical: false,
api_key: WORDNIK_KEY
});
if (!body.length) return msg.say('No Results.');
if (!body.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x9797FF)
.setTitle(body[0].word)
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class DiscrimCommand extends Command {
const discrim = args.discrim || msg.author.discriminator;
const users = this.client.users.filter(user => user.discriminator === discrim).map(user => user.username);
const embed = new MessageEmbed()
.setTitle(`${users.length} Users with the discriminator: ${discrim}`)
.setTitle(`${users.length} Users with the discriminator #${discrim}`)
.setColor(0x9797FF)
.setDescription(users.join(', '));
return msg.embed(embed);
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class ForecastCommand extends Command {
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${query}")`, // eslint-disable-line max-len
format: 'json'
});
if (!body.query.count) return msg.say('Location Not Found.');
if (!body.query.count) return msg.say('Could not find any results.');
const forecasts = body.query.results.channel.item.forecast;
const embed = new MessageEmbed()
.setColor(0x0000FF)
+1 -1
View File
@@ -12,7 +12,7 @@ module.exports = class GiphyCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What GIF would you like to search for?',
type: 'string'
}
]
+4 -4
View File
@@ -10,7 +10,7 @@ module.exports = class GitHubCommand extends Command {
name: 'github',
group: 'search',
memberName: 'github',
description: 'Searches GitHub for info on a GitHub repository.',
description: 'Searches GitHub for information on a repository.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
@@ -20,7 +20,7 @@ module.exports = class GitHubCommand extends Command {
},
{
key: 'repository',
prompt: 'What is the name of the repository you would like to get information for?',
prompt: 'What is the name of the repository?',
type: 'string'
}
]
@@ -37,7 +37,7 @@ module.exports = class GitHubCommand extends Command {
.setAuthor('GitHub', 'https://i.imgur.com/bRROLzk.png')
.setTitle(body.full_name)
.setURL(body.html_url)
.setDescription(body.description || 'No Description.')
.setDescription(body.description || 'No description.')
.setThumbnail(body.owner.avatar_url || null)
.addField(' Stars',
body.stargazers_count, true)
@@ -53,7 +53,7 @@ module.exports = class GitHubCommand extends Command {
moment(body.updated_at).format('MMMM Do YYYY'), true);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Not Found.');
if (err.status === 404) return msg.say('Could not find the repository.');
throw err;
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class MangaCommand extends Command {
manga.entry[0].end_date[0], true);
return msg.embed(embed);
} catch (err) {
if (err.message === 'Parse Error') return msg.say('No Results.');
if (err.message === 'Parse Error') return msg.say('Could not find any results.');
throw err;
}
}
+3 -3
View File
@@ -14,16 +14,16 @@ module.exports = class MapCommand extends Command {
{
key: 'zoom',
label: 'zoom level',
prompt: 'What would you like the zoom level for the map to be? Limit 1-20.',
prompt: 'What would you like the zoom level to be? Must be a number from 1-20.',
type: 'integer',
validate: zoom => {
if (zoom < 21 && zoom > 0) return true;
return 'Please enter a zoom value from 1-20';
return 'Please enter a zoom value from 1-20.';
}
},
{
key: 'query',
prompt: 'What location you like to get a map image for?',
prompt: 'What location would you like to get a map of?',
type: 'string'
}
]
+2 -2
View File
@@ -16,7 +16,7 @@ module.exports = class MovieCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What movie would you like to search for?',
type: 'string'
}
]
@@ -32,7 +32,7 @@ module.exports = class MovieCommand extends Command {
include_adult: msg.channel.nsfw || false,
query
});
if (!search.body.results.length) return msg.say('No Results.');
if (!search.body.results.length) return msg.say('Could not find any results.');
const { body } = await snekfetch
.get(`https://api.themoviedb.org/3/movie/${search.body.results[0].id}`)
.query({ api_key: TMDB_KEY });
+2 -2
View File
@@ -11,7 +11,7 @@ module.exports = class NeopetCommand extends Command {
args: [
{
key: 'query',
prompt: 'What pet would you like to get the image of?',
prompt: 'What pet would you like to get an image of?',
type: 'string'
}
]
@@ -28,7 +28,7 @@ module.exports = class NeopetCommand extends Command {
mood: 1
});
const link = text.match(/http:\/\/pets\.neopets\.com\/cp\/.+\.png/);
if (!link) return msg.say('Invalid Pet Name.');
if (!link) return msg.say('Could not find any results.');
return msg.say(link[0]);
}
};
+2 -2
View File
@@ -15,7 +15,7 @@ module.exports = class NPMCommand extends Command {
args: [
{
key: 'query',
prompt: 'What package do you want to get information for?',
prompt: 'What package would you like to search for?',
type: 'string'
}
]
@@ -51,7 +51,7 @@ module.exports = class NPMCommand extends Command {
body.maintainers.map(user => user.name).join(', '));
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Not Found.');
if (err.status === 404) return msg.say('Could not find any results.');
throw err;
}
}
+11 -11
View File
@@ -14,7 +14,7 @@ module.exports = class OsuCommand extends Command {
args: [
{
key: 'query',
prompt: 'What osu username would you like to search for?',
prompt: 'What user would you like to get information on?',
type: 'string'
}
]
@@ -30,7 +30,7 @@ module.exports = class OsuCommand extends Command {
u: query,
type: 'string'
});
if (!body.length) return msg.say('No Results.');
if (!body.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xFF66AA)
.setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png')
@@ -40,25 +40,25 @@ module.exports = class OsuCommand extends Command {
.addField(' ID',
body[0].user_id, true)
.addField(' Level',
body[0].level, true)
body[0].level || 'N/A', true)
.addField(' Accuracy',
body[0].accuracy, true)
body[0].accuracy || 'N/A', true)
.addField(' Rank',
body[0].pp_rank, true)
body[0].pp_rank || 'N/A', true)
.addField(' Play Count',
body[0].playcount, true)
body[0].playcount || 'N/A', true)
.addField(' Country',
body[0].country || 'N/A', true)
.addField(' Ranked Score',
body[0].ranked_score, true)
body[0].ranked_score || 'N/A', true)
.addField(' Total Score',
body[0].total_score, true)
body[0].total_score || 'N/A', true)
.addField(' SS',
body[0].count_rank_ss, true)
body[0].count_rank_ss || 'N/A', true)
.addField(' S',
body[0].count_rank_s, true)
body[0].count_rank_s || 'N/A', true)
.addField(' A',
body[0].count_rank_a, true);
body[0].count_rank_a || 'N/A', true);
return msg.embed(embed);
}
};
+3 -3
View File
@@ -16,9 +16,9 @@ module.exports = class PokedexCommand extends Command {
args: [
{
key: 'pokemon',
prompt: 'What Pokémon would you like to search for?',
prompt: 'What Pokémon would you like to get information on?',
type: 'string',
parse: pokemon => pokemon.toLowerCase().replace(/[ ]/g, '-')
parse: pokemon => pokemon.toLowerCase().replace(/ /g, '-')
}
]
});
@@ -41,7 +41,7 @@ module.exports = class PokedexCommand extends Command {
.setThumbnail(`https://www.serebii.net/sunmoon/pokemon/${id}.png`);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Pokémon Not Found.');
if (err.status === 404) return msg.say('Could not find any results.');
throw err;
}
}
+3 -3
View File
@@ -13,7 +13,7 @@ module.exports = class RecipeCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What recipe would you like to search for?',
type: 'string'
}
]
@@ -27,7 +27,7 @@ module.exports = class RecipeCommand extends Command {
.get('http://www.recipepuppy.com/api/')
.query({ q: query });
const body = JSON.parse(text);
if (!body.results.length) return msg.say('No Results.');
if (!body.results.length) return msg.say('Could not find any results.');
const recipe = body.results[Math.floor(Math.random() * body.results.length)];
const embed = new MessageEmbed()
.setColor(0xC20000)
@@ -37,7 +37,7 @@ module.exports = class RecipeCommand extends Command {
.setThumbnail(recipe.thumbnail);
return msg.embed(embed);
} catch (err) {
return msg.say('No Results.');
return msg.say('Could not find any results.');
}
}
};
+5 -5
View File
@@ -13,7 +13,7 @@ module.exports = class RedditCommand extends Command {
args: [
{
key: 'subreddit',
prompt: 'What subreddit would you like to get data for?',
prompt: 'What subreddit would you like to get a post from?',
type: 'string'
}
]
@@ -26,10 +26,10 @@ module.exports = class RedditCommand extends Command {
const { body } = await snekfetch
.get(`https://www.reddit.com/r/${subreddit}/new.json`)
.query({ sort: 'new' });
if (!body.data.children.length) return msg.say('Subreddit Not Found.');
if (!body.data.children.length) return msg.say('Could not find any results.');
const post = body.data.children[Math.floor(Math.random() * body.data.children.length)];
if (!post.data) return msg.say('This post has no data, try again!');
if (!msg.channel.nsfw && post.data.over_18) return msg.say('This post is only viewable in NSFW Channels.');
if (!msg.channel.nsfw && post.data.over_18) return msg.say('This post is only viewable in NSFW channels.');
const embed = new MessageEmbed()
.setColor(0xFF4500)
.setAuthor('Reddit', 'https://i.imgur.com/V6hXniU.png')
@@ -45,8 +45,8 @@ module.exports = class RedditCommand extends Command {
post.data.score, true);
return msg.embed(embed);
} catch (err) {
if (err.status === 403) return msg.say('This Subreddit is Private.');
if (err.status === 404) return msg.say('Subreddit Not Found.');
if (err.status === 403) return msg.say('This subreddit is private.');
if (err.status === 404) return msg.say('Could not find the subreddit.');
throw err;
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ module.exports = class SoundCloudCommand extends Command {
args: [
{
key: 'query',
prompt: 'What do you want to search SoundCloud for?',
prompt: 'What song would you like to search for?',
type: 'string'
}
]
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class SteamCommand extends Command {
l: 'en',
term: query
});
if (!body.total) return msg.say('No Results.');
if (!body.total) return msg.say('Could not find any results.');
const current = body.items[0].price ? body.items[0].price.final / 100 : 0.00;
const original = body.items[0].price ? body.items[0].price.initial / 100 : 0.00;
const price = current === original ? `$${current}` : `~~$${original}~~ $${current}`;
+2 -2
View File
@@ -16,7 +16,7 @@ module.exports = class TVShowCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What TV show would you like to search for?',
type: 'string'
}
]
@@ -32,7 +32,7 @@ module.exports = class TVShowCommand extends Command {
include_adult: msg.channel.nsfw || false,
query
});
if (!search.body.results.length) return msg.say('No Results.');
if (!search.body.results.length) return msg.say('Could not find any results.');
const { body } = await snekfetch
.get(`https://api.themoviedb.org/3/tv/${search.body.results[0].id}`)
.query({ api_key: TMDB_KEY });
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class UrbanCommand extends Command {
const { body } = await snekfetch
.get('http://api.urbandictionary.com/v0/define')
.query({ term: query });
if (!body.list.length) return msg.say('No Results.');
if (!body.list.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x32A8F0)
.setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png')
+1 -1
View File
@@ -35,7 +35,7 @@ module.exports = class VocaloidCommand extends Command {
nameMatchMode: 'Words',
fields: 'ThumbUrl,Lyrics'
});
if (!body.totalCount) return msg.say('No Results.');
if (!body.totalCount) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x86D2D0)
.setAuthor('VocaDB', 'https://i.imgur.com/9Tx9UIc.jpg')
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class WattpadCommand extends Command {
limit: 1
})
.set({ Authorization: `Basic ${WATTPAD_KEY}` });
if (!body.stories.length) return msg.say('No Results.');
if (!body.stories.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xF89C34)
.setAuthor('Wattpad', 'https://i.imgur.com/Rw9vRQB.png')
+2 -2
View File
@@ -13,7 +13,7 @@ module.exports = class WeatherCommand extends Command {
args: [
{
key: 'query',
prompt: 'What location would you like to get the current weather for?',
prompt: 'What location would you like to get the weather of?',
type: 'string'
}
]
@@ -28,7 +28,7 @@ module.exports = class WeatherCommand extends Command {
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${query}")`, // eslint-disable-line max-len
format: 'json'
});
if (!body.query.count) return msg.say('Location Not Found.');
if (!body.query.count) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x0000FF)
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
+3 -3
View File
@@ -15,12 +15,12 @@ module.exports = class WikiaCommand extends Command {
args: [
{
key: 'wiki',
prompt: 'What is the subdomain of the wikia you want to search?',
prompt: 'What is the subdomain of the wiki you want to search?',
type: 'string'
},
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What article would you like to search for?',
type: 'string'
}
]
@@ -49,7 +49,7 @@ module.exports = class WikiaCommand extends Command {
.setThumbnail(body.sections[0].images.length ? body.sections[0].images[0].src : null);
return msg.embed(embed);
} catch (err) {
return msg.say('No Results or Invalid Wiki.');
return msg.say('Could not find any results.');
}
}
};
+2 -2
View File
@@ -14,7 +14,7 @@ module.exports = class WikipediaCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What article would you like to search for?',
type: 'string'
}
]
@@ -35,7 +35,7 @@ module.exports = class WikipediaCommand extends Command {
redirects: '',
formatversion: 2
});
if (body.query.pages[0].missing) return msg.say('No Results.');
if (body.query.pages[0].missing) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xE7E7E7)
.setTitle(body.query.pages[0].title)
+2 -2
View File
@@ -14,7 +14,7 @@ module.exports = class YouTubeCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What video would you like to search for?',
type: 'string'
}
]
@@ -32,7 +32,7 @@ module.exports = class YouTubeCommand extends Command {
q: query,
key: GOOGLE_KEY
});
if (!body.items.length) return msg.say('No Results.');
if (!body.items.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xDD2825)
.setTitle(body.items[0].snippet.title)
+2 -2
View File
@@ -13,7 +13,7 @@ module.exports = class YuGiOhCommand extends Command {
args: [
{
key: 'query',
prompt: 'What card would you like to get data for?',
prompt: 'What card would you like to get information on?',
type: 'string',
parse: text => encodeURIComponent(text)
}
@@ -25,7 +25,7 @@ module.exports = class YuGiOhCommand extends Command {
const { query } = args;
const { body } = await snekfetch
.get(`http://yugiohprices.com/api/card_data/${query}`);
if (body.status === 'fail') return msg.say('No Results.');
if (body.status === 'fail') return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xBE5F1F)
.setTitle(body.data.name)