diff --git a/commands/avatar-edit/simba.js b/commands/avatar-edit/simba.js index 3eb31afd..32f384fa 100644 --- a/commands/avatar-edit/simba.js +++ b/commands/avatar-edit/simba.js @@ -7,6 +7,7 @@ module.exports = class SimbaCommand extends Command { constructor(client) { super(client, { name: 'simba', + aliases: ['mufasa', 'he-lives-in-you'], group: 'avatar-edit', memberName: 'simba', description: 'Draws a user\'s avatar over Simba from The Lion King\'s reflection.', diff --git a/commands/avatar-edit/wanted.js b/commands/avatar-edit/wanted.js index c3599806..30defdb1 100644 --- a/commands/avatar-edit/wanted.js +++ b/commands/avatar-edit/wanted.js @@ -7,6 +7,7 @@ module.exports = class WantedCommand extends Command { constructor(client) { super(client, { name: 'wanted', + aliases: ['wanted-poster'], group: 'avatar-edit', memberName: 'wanted', description: 'Draws a user\'s avatar over a wanted poster.', diff --git a/commands/avatar-edit/yu-gi-oh-token.js b/commands/avatar-edit/yu-gi-oh-token.js index ece00f0e..634fe4e4 100644 --- a/commands/avatar-edit/yu-gi-oh-token.js +++ b/commands/avatar-edit/yu-gi-oh-token.js @@ -7,6 +7,7 @@ module.exports = class YuGiOhTokenCommand extends Command { constructor(client) { super(client, { name: 'yu-gi-oh-token', + aliases: ['ygo-token'], group: 'avatar-edit', memberName: 'yu-gi-oh-token', description: 'Draws a user\'s avatar over a blank Yu-Gi-Oh! Token card.', diff --git a/commands/games/akinator.js b/commands/games/akinator.js index 911fd348..b720598c 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -7,6 +7,7 @@ module.exports = class AkinatorCommand extends Command { constructor(client) { super(client, { name: 'akinator', + aliases: ['the-web-genie', 'web-genie'], group: 'games', memberName: 'akinator', description: 'Play a game of Akinator!' diff --git a/commands/games/math-game.js b/commands/games/math-game.js index d4350337..0ff48fcf 100644 --- a/commands/games/math-game.js +++ b/commands/games/math-game.js @@ -16,6 +16,7 @@ module.exports = class MathGameCommand extends Command { constructor(client) { super(client, { name: 'math-game', + aliases: ['math-quiz', 'math-test'], group: 'games', memberName: 'math-game', description: 'See how fast you can answer a math problem in a given time limit.', diff --git a/commands/games/typing-game.js b/commands/games/typing-game.js index 0ab6e385..e5d85cc9 100644 --- a/commands/games/typing-game.js +++ b/commands/games/typing-game.js @@ -15,6 +15,7 @@ module.exports = class TypingGameCommand extends Command { constructor(client) { super(client, { name: 'typing-game', + aliases: ['typing-test'], group: 'games', memberName: 'typing-game', description: 'See how fast you can type a sentence in a given time limit.', diff --git a/commands/moderation/prune.js b/commands/moderation/prune.js index 105ba8b9..4be7b46e 100644 --- a/commands/moderation/prune.js +++ b/commands/moderation/prune.js @@ -4,6 +4,7 @@ module.exports = class PruneCommand extends Command { constructor(client) { super(client, { name: 'prune', + aliases: ['clear'], group: 'moderation', memberName: 'prune', description: 'Deletes up to 99 messages from the current channel.', @@ -30,9 +31,13 @@ module.exports = class PruneCommand extends Command { } async run(msg, { count }) { - const messages = await msg.channel.messages.fetch({ limit: count + 1 }); - const msgs = await msg.channel.bulkDelete(messages, true); - if (!msgs.size) return msg.say('There are no messages younger than two weeks that can be deleted.'); - return null; + try { + const messages = await msg.channel.messages.fetch({ limit: count + 1 }); + const msgs = await msg.channel.bulkDelete(messages, true); + if (!msgs.size) return msg.say('There are no messages younger than two weeks that can be deleted.'); + return null; + } catch (err) { + return msg.say('There are no messages younger than two weeks that can be deleted.'); + } } }; diff --git a/commands/num-edit/math.js b/commands/num-edit/math.js index 3c8abfec..fde7d6f4 100644 --- a/commands/num-edit/math.js +++ b/commands/num-edit/math.js @@ -5,7 +5,7 @@ module.exports = class MathCommand extends Command { constructor(client) { super(client, { name: 'math', - aliases: ['calculator', 'calculate'], + aliases: ['calculator', 'calculate', 'calc'], group: 'num-edit', memberName: 'math', description: 'Calculates math expressions.', diff --git a/commands/random/tableflip.js b/commands/random/tableflip.js index 2dcdb352..e3610b9e 100644 --- a/commands/random/tableflip.js +++ b/commands/random/tableflip.js @@ -12,7 +12,7 @@ module.exports = class TableflipCommand extends Command { constructor(client) { super(client, { name: 'tableflip', - aliases: ['a-tableflip', 'animated-tableflip'], + aliases: ['a-tableflip', 'animated-tableflip', 'tableflip-animated', 'tableflip-a'], group: 'random', memberName: 'tableflip', description: 'Flips a table... With animation!' diff --git a/commands/search/bot-info.js b/commands/search/bot-info.js index c174360d..65f93f58 100644 --- a/commands/search/bot-info.js +++ b/commands/search/bot-info.js @@ -7,6 +7,7 @@ module.exports = class BotSearchCommand extends Command { constructor(client) { super(client, { name: 'bot-info', + aliases: ['discord-bots', 'dbots'], group: 'search', memberName: 'bot-info', description: 'Searches Discord Bots for information on a bot.', diff --git a/commands/search/derpibooru.js b/commands/search/derpibooru.js index caa18201..e77637fa 100644 --- a/commands/search/derpibooru.js +++ b/commands/search/derpibooru.js @@ -5,7 +5,7 @@ module.exports = class DerpibooruCommand extends Command { constructor(client) { super(client, { name: 'derpibooru', - aliases: ['my-little-pony-image', 'mlp-image'], + aliases: ['my-little-pony-image', 'mlp-image', 'derpibooru-image'], group: 'search', memberName: 'derpibooru', description: 'Searches Derpibooru for your query.', diff --git a/commands/search/define.js b/commands/search/dictionary.js similarity index 82% rename from commands/search/define.js rename to commands/search/dictionary.js index 28ebe12c..18038fb8 100644 --- a/commands/search/define.js +++ b/commands/search/dictionary.js @@ -3,19 +3,19 @@ const { MessageEmbed } = require('discord.js'); const snekfetch = require('snekfetch'); const { WORDNIK_KEY } = process.env; -module.exports = class DefineCommand extends Command { +module.exports = class DictionaryCommand extends Command { constructor(client) { super(client, { - name: 'define', - aliases: ['dictionary', 'wordnik', 'define-wordnik'], + name: 'dictionary', + aliases: ['define', 'wordnik', 'define-wordnik'], group: 'search', - memberName: 'define', + memberName: 'dictionary', description: 'Defines a word.', clientPermissions: ['EMBED_LINKS'], args: [ { key: 'query', - prompt: 'What would you like to define?', + prompt: 'What word would you like to look up?', type: 'string', parse: query => encodeURIComponent(query) } diff --git a/commands/search/github.js b/commands/search/github.js index c3064833..9c8fc5b6 100644 --- a/commands/search/github.js +++ b/commands/search/github.js @@ -7,7 +7,7 @@ module.exports = class GitHubCommand extends Command { constructor(client) { super(client, { name: 'github', - aliases: ['github-repository', 'github-repo'], + aliases: ['github-repository', 'github-repo', 'git-repo'], group: 'search', memberName: 'github', description: 'Searches GitHub for information on a repository.', diff --git a/commands/search/japanese-define.js b/commands/search/jisho.js similarity index 82% rename from commands/search/japanese-define.js rename to commands/search/jisho.js index 2c0712a9..344be492 100644 --- a/commands/search/japanese-define.js +++ b/commands/search/jisho.js @@ -2,19 +2,19 @@ const Command = require('../../structures/Command'); const { MessageEmbed } = require('discord.js'); const snekfetch = require('snekfetch'); -module.exports = class JapaneseDefineCommand extends Command { +module.exports = class JishoCommand extends Command { constructor(client) { super(client, { - name: 'japanese-define', - aliases: ['japanese-dictionary', 'define-japanese', 'define-jpn', 'jpn-define', 'jisho'], + name: 'jisho', + aliases: ['japanese-dictionary', 'define-japanese', 'define-jpn', 'jpn-define', 'japanese-define'], group: 'search', - memberName: 'japanese-dictionary', + memberName: 'jisho', description: 'Defines a word, but with Japanese.', clientPermissions: ['EMBED_LINKS'], args: [ { key: 'query', - prompt: 'What would you like to define?', + prompt: 'What word would you like to look up?', type: 'string' } ] diff --git a/commands/search/osu.js b/commands/search/osu.js index 8a749cac..f8eb2a67 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -7,7 +7,7 @@ module.exports = class OsuCommand extends Command { constructor(client) { super(client, { name: 'osu', - aliases: ['osu-user'], + aliases: ['osu-user', 'osu-stats'], group: 'search', memberName: 'osu', description: 'Searches osu! usernames for your query.', diff --git a/commands/search/stocks.js b/commands/search/stocks.js index 1ab678e3..d66d5dc5 100644 --- a/commands/search/stocks.js +++ b/commands/search/stocks.js @@ -7,7 +7,7 @@ module.exports = class StocksCommand extends Command { constructor(client) { super(client, { name: 'stocks', - aliases: ['stock'], + aliases: ['stock', 'alpha-vantage'], group: 'search', memberName: 'stocks', description: 'Get the current stocks for a symbol.', diff --git a/commands/search/thesaurus.js b/commands/search/thesaurus.js new file mode 100644 index 00000000..9c3e53cd --- /dev/null +++ b/commands/search/thesaurus.js @@ -0,0 +1,50 @@ +const Command = require('../../structures/Command'); +const { MessageEmbed } = require('discord.js'); +const snekfetch = require('snekfetch'); +const { WORDNIK_KEY } = process.env; + +module.exports = class ThesaurusCommand extends Command { + constructor(client) { + super(client, { + name: 'thesaurus', + aliases: ['synonym', 'antonym', 'thesaurus-wordnik', 'wordnik-thesaurus'], + group: 'search', + memberName: 'thesaurus', + description: 'Gets the synonyms and antonyms of a word.', + clientPermissions: ['EMBED_LINKS'], + args: [ + { + key: 'query', + prompt: 'What word would you like to look up?', + type: 'string', + parse: query => encodeURIComponent(query) + } + ] + }); + } + + async run(msg, { query }) { + try { + const { body } = await snekfetch + .get(`http://api.wordnik.com/v4/word.json/${query}/relatedWords`) + .query({ + relationshipTypes: ['synonym', 'antonym'], + limitPerRelationshipType: 5, + api_key: WORDNIK_KEY + }); + if (!body.length) return msg.say('Could not find any results.'); + const synonyms = body.find(i => i.relationshipType === 'synonym'); + const antonyms = body.find(i => i.relationshipType === 'antonym'); + const embed = new MessageEmbed() + .setColor(0x9797FF) + .setTitle(query) + .addField('> Synonyms', + synonyms.words ? synonyms.words.join(', ') : 'N/A') + .addField('> Antonyms', + antonyms.words ? antonyms.words.join(', ') : 'N/A'); + return msg.embed(embed); + } catch (err) { + return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/commands/search/weather.js b/commands/search/weather.js index 912f4bdf..cda36098 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -9,6 +9,7 @@ module.exports = class WeatherCommand extends Command { constructor(client) { super(client, { name: 'weather', + aliases: ['open-weather-map'], group: 'search', memberName: 'weather', description: 'Responds with weather information for a specified location.', diff --git a/commands/search/yu-gi-oh.js b/commands/search/yu-gi-oh.js index 795c05ce..09f0e615 100644 --- a/commands/search/yu-gi-oh.js +++ b/commands/search/yu-gi-oh.js @@ -6,7 +6,7 @@ module.exports = class YuGiOhCommand extends Command { constructor(client) { super(client, { name: 'yu-gi-oh', - aliases: ['yu-gi-oh-card'], + aliases: ['yu-gi-oh-card', 'ygo-card', 'ygo'], group: 'search', memberName: 'yu-gi-oh', description: 'Responds with info on a Yu-Gi-Oh! card.', diff --git a/commands/user-info/avatar.js b/commands/user-info/avatar.js index 37c5ba04..c07633a7 100644 --- a/commands/user-info/avatar.js +++ b/commands/user-info/avatar.js @@ -4,6 +4,7 @@ module.exports = class AvatarCommand extends Command { constructor(client) { super(client, { name: 'avatar', + aliases: ['profile-picture', 'profile-pic'], group: 'user-info', memberName: 'avatar', description: 'Responds with a link to a user\'s avatar.', diff --git a/commands/util/donate.js b/commands/util/donate.js index 10a04570..76549cb1 100644 --- a/commands/util/donate.js +++ b/commands/util/donate.js @@ -5,7 +5,7 @@ module.exports = class DonateCommand extends Command { constructor(client) { super(client, { name: 'donate', - aliases: ['patreon', 'paypal', 'ko-fi'], + aliases: ['patreon', 'paypal', 'ko-fi', 'donators'], group: 'util', memberName: 'donate', description: 'Responds with Xiao\'s donation links.', diff --git a/commands/util/help.js b/commands/util/help.js index 3ce905c4..0d389360 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -6,7 +6,7 @@ module.exports = class HelpCommand extends Command { constructor(client) { super(client, { name: 'help', - aliases: ['commands'], + aliases: ['commands', 'command-list'], group: 'util', memberName: 'help', description: 'Displays a list of available commands, or detailed information for a specified command.',