mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
More Aliases, Thesaurus
This commit is contained in:
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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!'
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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!'
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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.',
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
]
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
Reference in New Issue
Block a user