mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 14:21:41 +02:00
More Aliases, Thesaurus
This commit is contained in:
@@ -7,6 +7,7 @@ module.exports = class SimbaCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'simba',
|
name: 'simba',
|
||||||
|
aliases: ['mufasa', 'he-lives-in-you'],
|
||||||
group: 'avatar-edit',
|
group: 'avatar-edit',
|
||||||
memberName: 'simba',
|
memberName: 'simba',
|
||||||
description: 'Draws a user\'s avatar over Simba from The Lion King\'s reflection.',
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'wanted',
|
name: 'wanted',
|
||||||
|
aliases: ['wanted-poster'],
|
||||||
group: 'avatar-edit',
|
group: 'avatar-edit',
|
||||||
memberName: 'wanted',
|
memberName: 'wanted',
|
||||||
description: 'Draws a user\'s avatar over a wanted poster.',
|
description: 'Draws a user\'s avatar over a wanted poster.',
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = class YuGiOhTokenCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'yu-gi-oh-token',
|
name: 'yu-gi-oh-token',
|
||||||
|
aliases: ['ygo-token'],
|
||||||
group: 'avatar-edit',
|
group: 'avatar-edit',
|
||||||
memberName: 'yu-gi-oh-token',
|
memberName: 'yu-gi-oh-token',
|
||||||
description: 'Draws a user\'s avatar over a blank Yu-Gi-Oh! Token card.',
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'akinator',
|
name: 'akinator',
|
||||||
|
aliases: ['the-web-genie', 'web-genie'],
|
||||||
group: 'games',
|
group: 'games',
|
||||||
memberName: 'akinator',
|
memberName: 'akinator',
|
||||||
description: 'Play a game of Akinator!'
|
description: 'Play a game of Akinator!'
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ module.exports = class MathGameCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'math-game',
|
name: 'math-game',
|
||||||
|
aliases: ['math-quiz', 'math-test'],
|
||||||
group: 'games',
|
group: 'games',
|
||||||
memberName: 'math-game',
|
memberName: 'math-game',
|
||||||
description: 'See how fast you can answer a math problem in a given time limit.',
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'typing-game',
|
name: 'typing-game',
|
||||||
|
aliases: ['typing-test'],
|
||||||
group: 'games',
|
group: 'games',
|
||||||
memberName: 'typing-game',
|
memberName: 'typing-game',
|
||||||
description: 'See how fast you can type a sentence in a given time limit.',
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'prune',
|
name: 'prune',
|
||||||
|
aliases: ['clear'],
|
||||||
group: 'moderation',
|
group: 'moderation',
|
||||||
memberName: 'prune',
|
memberName: 'prune',
|
||||||
description: 'Deletes up to 99 messages from the current channel.',
|
description: 'Deletes up to 99 messages from the current channel.',
|
||||||
@@ -30,9 +31,13 @@ module.exports = class PruneCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, { count }) {
|
async run(msg, { count }) {
|
||||||
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
|
try {
|
||||||
const msgs = await msg.channel.bulkDelete(messages, true);
|
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
|
||||||
if (!msgs.size) return msg.say('There are no messages younger than two weeks that can be deleted.');
|
const msgs = await msg.channel.bulkDelete(messages, true);
|
||||||
return null;
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'math',
|
name: 'math',
|
||||||
aliases: ['calculator', 'calculate'],
|
aliases: ['calculator', 'calculate', 'calc'],
|
||||||
group: 'num-edit',
|
group: 'num-edit',
|
||||||
memberName: 'math',
|
memberName: 'math',
|
||||||
description: 'Calculates math expressions.',
|
description: 'Calculates math expressions.',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module.exports = class TableflipCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'tableflip',
|
name: 'tableflip',
|
||||||
aliases: ['a-tableflip', 'animated-tableflip'],
|
aliases: ['a-tableflip', 'animated-tableflip', 'tableflip-animated', 'tableflip-a'],
|
||||||
group: 'random',
|
group: 'random',
|
||||||
memberName: 'tableflip',
|
memberName: 'tableflip',
|
||||||
description: 'Flips a table... With animation!'
|
description: 'Flips a table... With animation!'
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = class BotSearchCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'bot-info',
|
name: 'bot-info',
|
||||||
|
aliases: ['discord-bots', 'dbots'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'bot-info',
|
memberName: 'bot-info',
|
||||||
description: 'Searches Discord Bots for information on a bot.',
|
description: 'Searches Discord Bots for information on a bot.',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module.exports = class DerpibooruCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'derpibooru',
|
name: 'derpibooru',
|
||||||
aliases: ['my-little-pony-image', 'mlp-image'],
|
aliases: ['my-little-pony-image', 'mlp-image', 'derpibooru-image'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'derpibooru',
|
memberName: 'derpibooru',
|
||||||
description: 'Searches Derpibooru for your query.',
|
description: 'Searches Derpibooru for your query.',
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ const { MessageEmbed } = require('discord.js');
|
|||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
const { WORDNIK_KEY } = process.env;
|
const { WORDNIK_KEY } = process.env;
|
||||||
|
|
||||||
module.exports = class DefineCommand extends Command {
|
module.exports = class DictionaryCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'define',
|
name: 'dictionary',
|
||||||
aliases: ['dictionary', 'wordnik', 'define-wordnik'],
|
aliases: ['define', 'wordnik', 'define-wordnik'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'define',
|
memberName: 'dictionary',
|
||||||
description: 'Defines a word.',
|
description: 'Defines a word.',
|
||||||
clientPermissions: ['EMBED_LINKS'],
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
prompt: 'What would you like to define?',
|
prompt: 'What word would you like to look up?',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
parse: query => encodeURIComponent(query)
|
parse: query => encodeURIComponent(query)
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ module.exports = class GitHubCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'github',
|
name: 'github',
|
||||||
aliases: ['github-repository', 'github-repo'],
|
aliases: ['github-repository', 'github-repo', 'git-repo'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'github',
|
memberName: 'github',
|
||||||
description: 'Searches GitHub for information on a repository.',
|
description: 'Searches GitHub for information on a repository.',
|
||||||
|
|||||||
@@ -2,19 +2,19 @@ const Command = require('../../structures/Command');
|
|||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
|
|
||||||
module.exports = class JapaneseDefineCommand extends Command {
|
module.exports = class JishoCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'japanese-define',
|
name: 'jisho',
|
||||||
aliases: ['japanese-dictionary', 'define-japanese', 'define-jpn', 'jpn-define', 'jisho'],
|
aliases: ['japanese-dictionary', 'define-japanese', 'define-jpn', 'jpn-define', 'japanese-define'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'japanese-dictionary',
|
memberName: 'jisho',
|
||||||
description: 'Defines a word, but with Japanese.',
|
description: 'Defines a word, but with Japanese.',
|
||||||
clientPermissions: ['EMBED_LINKS'],
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
prompt: 'What would you like to define?',
|
prompt: 'What word would you like to look up?',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -7,7 +7,7 @@ module.exports = class OsuCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'osu',
|
name: 'osu',
|
||||||
aliases: ['osu-user'],
|
aliases: ['osu-user', 'osu-stats'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'osu',
|
memberName: 'osu',
|
||||||
description: 'Searches osu! usernames for your query.',
|
description: 'Searches osu! usernames for your query.',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module.exports = class StocksCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'stocks',
|
name: 'stocks',
|
||||||
aliases: ['stock'],
|
aliases: ['stock', 'alpha-vantage'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'stocks',
|
memberName: 'stocks',
|
||||||
description: 'Get the current stocks for a symbol.',
|
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) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'weather',
|
name: 'weather',
|
||||||
|
aliases: ['open-weather-map'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'weather',
|
memberName: 'weather',
|
||||||
description: 'Responds with weather information for a specified location.',
|
description: 'Responds with weather information for a specified location.',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = class YuGiOhCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'yu-gi-oh',
|
name: 'yu-gi-oh',
|
||||||
aliases: ['yu-gi-oh-card'],
|
aliases: ['yu-gi-oh-card', 'ygo-card', 'ygo'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'yu-gi-oh',
|
memberName: 'yu-gi-oh',
|
||||||
description: 'Responds with info on a Yu-Gi-Oh! card.',
|
description: 'Responds with info on a Yu-Gi-Oh! card.',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ module.exports = class AvatarCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'avatar',
|
name: 'avatar',
|
||||||
|
aliases: ['profile-picture', 'profile-pic'],
|
||||||
group: 'user-info',
|
group: 'user-info',
|
||||||
memberName: 'avatar',
|
memberName: 'avatar',
|
||||||
description: 'Responds with a link to a user\'s avatar.',
|
description: 'Responds with a link to a user\'s avatar.',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module.exports = class DonateCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'donate',
|
name: 'donate',
|
||||||
aliases: ['patreon', 'paypal', 'ko-fi'],
|
aliases: ['patreon', 'paypal', 'ko-fi', 'donators'],
|
||||||
group: 'util',
|
group: 'util',
|
||||||
memberName: 'donate',
|
memberName: 'donate',
|
||||||
description: 'Responds with Xiao\'s donation links.',
|
description: 'Responds with Xiao\'s donation links.',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = class HelpCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'help',
|
name: 'help',
|
||||||
aliases: ['commands'],
|
aliases: ['commands', 'command-list'],
|
||||||
group: 'util',
|
group: 'util',
|
||||||
memberName: 'help',
|
memberName: 'help',
|
||||||
description: 'Displays a list of available commands, or detailed information for a specified command.',
|
description: 'Displays a list of available commands, or detailed information for a specified command.',
|
||||||
|
|||||||
Reference in New Issue
Block a user