Word of the Day, TONS of new aliases

This commit is contained in:
Daniel Odendahl Jr
2017-09-25 13:45:57 +00:00
parent 515fb8dc8c
commit d9d9219ddc
54 changed files with 86 additions and 18 deletions
+1
View File
@@ -5,6 +5,7 @@ module.exports = class GenderCommand extends Command {
constructor(client) {
super(client, {
name: 'gender',
aliases: ['gender-guess', 'guess-gender'],
group: 'random',
memberName: 'gender',
description: 'Determines the gender of name.',
+1
View File
@@ -4,6 +4,7 @@ module.exports = class LMGTFYCommand extends Command {
constructor(client) {
super(client, {
name: 'lmgtfy',
aliases: ['let-me-google-that-for-you', 'google'],
group: 'random',
memberName: 'lmgtfy',
description: 'Creates a LMGTFY link with the query you provide.',
+1 -1
View File
@@ -6,7 +6,7 @@ module.exports = class ShortenURLCommand extends Command {
constructor(client) {
super(client, {
name: 'shorten-url',
aliases: ['short-url', 'url-shorten'],
aliases: ['short-url', 'url-shorten', 'url-short'],
group: 'random',
memberName: 'shorten-url',
description: 'Creates a goo.gl short URL from another URL.',
+31
View File
@@ -0,0 +1,31 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
const { WORDNIK_KEY } = process.env;
module.exports = class DefineCommand extends Command {
constructor(client) {
super(client, {
name: 'word-of-the-day',
group: 'search',
memberName: 'word-of-the-day',
description: 'Gets the word of the day.',
clientPermissions: ['EMBED_LINKS']
});
}
async run(msg) {
try {
const { body } = await snekfetch
.get('http://api.wordnik.com/v4/words.json/wordOfTheDay')
.query({ api_key: WORDNIK_KEY });
const embed = new MessageEmbed()
.setColor(0x9797FF)
.setTitle(body.word)
.setDescription(`(${body.definitions[0].partOfSpeech}) ${body.definitions[0].text}`);
return msg.embed(embed);
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};