mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Remove commands that no longer work, fix others
This commit is contained in:
@@ -47,7 +47,7 @@ Xiao is a Discord bot coded in JavaScript with
|
||||
7. Run `npm i -g pm2` to install PM2.
|
||||
8. Run `pm2 start Xiao.js --name xiao` to run the bot.
|
||||
|
||||
## Commands (335)
|
||||
## Commands (332)
|
||||
### Utility:
|
||||
|
||||
* **eval:** Executes JavaScript code.
|
||||
@@ -77,7 +77,6 @@ Xiao is a Discord bot coded in JavaScript with
|
||||
|
||||
* **8-ball:** Asks your question to the Magic 8 Ball.
|
||||
* **advice:** Responds with a random bit of advice.
|
||||
* **bird:** Responds with a random bird image.
|
||||
* **cat-fact:** Responds with a random cat fact.
|
||||
* **cat:** Responds with a random cat image.
|
||||
* **charlie-charlie:** Asks your question to Charlie.
|
||||
@@ -179,7 +178,6 @@ Xiao is a Discord bot coded in JavaScript with
|
||||
* **imgur:** Searches Imgur for your query.
|
||||
* **itunes:** Searches iTunes for your query.
|
||||
* **jisho:** Defines a word, but with Japanese.
|
||||
* **kh-wiki:** Searches the Kingdom Hearts Wiki for your query.
|
||||
* **kickstarter:** Searches Kickstarter for your query.
|
||||
* **know-your-meme:** Searches Know Your Meme for your query.
|
||||
* **konachan:** Responds with an image from Konachan, with optional query.
|
||||
@@ -237,7 +235,6 @@ Xiao is a Discord bot coded in JavaScript with
|
||||
* **scrabble-score:** Responds with the scrabble score of a word.
|
||||
* **severe-toxicity:** Determines the toxicity of text, but less sensitive to milder language.
|
||||
* **ship:** Ships two users together.
|
||||
* **spoopy-link:** Determines if a link is spoopy or not.
|
||||
* **toxicity:** Determines the toxicity of text.
|
||||
* **what-anime:** Determines what anime a screenshot is from.
|
||||
* **zodiac-sign:** Responds with the Zodiac Sign for the given month/day.
|
||||
|
||||
@@ -7,7 +7,6 @@ const client = new Client({
|
||||
owner: OWNERS.split(','),
|
||||
invite: INVITE,
|
||||
disableEveryone: true,
|
||||
unknownCommandResponse: false,
|
||||
disabledEvents: ['TYPING_START']
|
||||
});
|
||||
const activities = require('./assets/json/activity');
|
||||
@@ -36,7 +35,8 @@ client.registry
|
||||
help: false,
|
||||
ping: false,
|
||||
prefix: false,
|
||||
commandState: false
|
||||
commandState: false,
|
||||
unknownCommand: false
|
||||
})
|
||||
.registerCommandsIn(path.join(__dirname, 'commands'));
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { FAILURE_EMOJI_ID, FAILURE_EMOJI_NAME, SUCCESS_EMOJI_ID, SUCCESS_EMOJI_NAME } = process.env;
|
||||
|
||||
module.exports = class SpoopyLinkCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'spoopy-link',
|
||||
group: 'analyze',
|
||||
memberName: 'spoopy-link',
|
||||
description: 'Determines if a link is spoopy or not.',
|
||||
args: [
|
||||
{
|
||||
key: 'site',
|
||||
prompt: 'What site do you think is spoopy?',
|
||||
type: 'string',
|
||||
parse: site => encodeURIComponent(site)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { site }) {
|
||||
try {
|
||||
const { body } = await request.get(`https://spoopy.link/api/${site}`);
|
||||
const chain = body.chain.map(
|
||||
url => `<${url.url}> ${url.safe ? this.successEmoji : `${this.failureEmoji} (${url.reasons.join(', ')})`}`
|
||||
);
|
||||
return msg.say(stripIndents`
|
||||
${body.safe ? 'Safe!' : 'Not safe...'}
|
||||
${chain.join('\n')}
|
||||
`);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
get successEmoji() {
|
||||
return SUCCESS_EMOJI_ID && SUCCESS_EMOJI_NAME ? `<:${SUCCESS_EMOJI_NAME}:${SUCCESS_EMOJI_ID}>` : '✅';
|
||||
}
|
||||
|
||||
get failureEmoji() {
|
||||
return FAILURE_EMOJI_ID && FAILURE_EMOJI_NAME ? `<:${FAILURE_EMOJI_NAME}:${FAILURE_EMOJI_ID}>` : '❌';
|
||||
}
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class BirdCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'bird',
|
||||
aliases: ['birb'],
|
||||
group: 'random',
|
||||
memberName: 'bird',
|
||||
description: 'Responds with a random bird image.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { text } = await request.get('http://random.birb.pw/tweet.json/');
|
||||
return msg.say({ files: [`https://random.birb.pw/img/${JSON.parse(text).file}`] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -49,6 +49,7 @@ module.exports = class FactCommand extends Command {
|
||||
format: 'json',
|
||||
formatversion: 2
|
||||
});
|
||||
if (!body.query.random[0].title) return 'Facts are hard to find sometimes.';
|
||||
return body.query.random[0].title;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -57,7 +57,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
.setAuthor('AniList', 'https://i.imgur.com/iUIRC7v.png', 'https://anilist.co/')
|
||||
.setURL(`https://anilist.co/anime/${anime.id}`)
|
||||
.setThumbnail(anime.coverImage.large || null)
|
||||
.setTitle(anime.title.userPreferred)
|
||||
.setTitle(anime.title.english || anime.title.userPreferred)
|
||||
.setDescription(anime.description ? shorten(anime.description.replace(/(<br>)+/g, '\n')) : 'No description.')
|
||||
.addField('❯ Status', anime.status, true)
|
||||
.addField('❯ Episodes', anime.episodes, true)
|
||||
|
||||
@@ -52,9 +52,9 @@ module.exports = class AzurLaneCommand extends Command {
|
||||
.addField('❯ Aviation', `${formatNumber(data.base.air_power)} (${formatNumber(data.max.air_power)} Max)`, true)
|
||||
.addField('❯ Oil Cost', `${formatNumber(data.base.oil_usage)} (${formatNumber(data.max.oil_usage)} Max)`, true)
|
||||
.addField('❯ Equipment', stripIndents`
|
||||
${data.equipment[0].equippable} (${data.equipment[0].efficiency})
|
||||
${data.equipment[1].equippable} (${data.equipment[1].efficiency})
|
||||
${data.equipment[2].equippable} (${data.equipment[2].efficiency})
|
||||
${data.equipment[0].equipable} (${data.equipment[0].efficiency})
|
||||
${data.equipment[1].equipable} (${data.equipment[1].efficiency})
|
||||
${data.equipment[2].equipable} (${data.equipment[2].efficiency})
|
||||
`)
|
||||
.addField('❯ Images',
|
||||
`${data.images.map(img => `[${img.name}](${img.url})`).join(', ')}, [Chibi](${data.chibi})`);
|
||||
|
||||
@@ -44,8 +44,7 @@ module.exports = class BookCommand extends Command {
|
||||
.setThumbnail(data.imageLinks ? data.imageLinks.thumbnail : null)
|
||||
.addField('❯ Authors', data.authors.length ? data.authors.join(', ') : '???')
|
||||
.addField('❯ Publish Date', data.publishedDate || '???', true)
|
||||
.addField('❯ Page Count', data.pageCount ? formatNumber(data.pageCount) : '???', true)
|
||||
.addField('❯ Genres', data.categories.length ? data.categories.join(', ') : '???');
|
||||
.addField('❯ Page Count', data.pageCount ? formatNumber(data.pageCount) : '???', true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const request = require('node-superfetch');
|
||||
const { shorten } = require('../../util/Util');
|
||||
|
||||
module.exports = class KhWikiCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'kh-wiki',
|
||||
aliases: ['kingdom-hearts-wiki'],
|
||||
group: 'search',
|
||||
memberName: 'kh-wiki',
|
||||
description: 'Searches the Kingdom Hearts Wiki for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What article would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://www.khwiki.com/api.php')
|
||||
.query({
|
||||
action: 'query',
|
||||
prop: 'extracts|pageimages',
|
||||
format: 'json',
|
||||
titles: query,
|
||||
exintro: '',
|
||||
explaintext: '',
|
||||
pithumbsize: 150,
|
||||
redirects: '',
|
||||
formatversion: 2
|
||||
});
|
||||
const data = body.query.pages[0];
|
||||
if (data.missing) return msg.say('Could not find any results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x0679BC)
|
||||
.setTitle(data.title)
|
||||
.setAuthor('Kingdom Hearts Wiki', 'https://i.imgur.com/OZhrA41.jpg', 'https://www.khwiki.com/')
|
||||
.setThumbnail(data.thumbnail ? data.thumbnail.source : null)
|
||||
.setURL(`https://www.khwiki.com/${encodeURIComponent(query).replace(/\)/g, '%29')}`)
|
||||
.setDescription(shorten(data.extract.replace(/.+\n\n/, '').replace(/\n/g, '\n\n')));
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -7,7 +7,7 @@ module.exports = class LeagueOfLegendsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'league-of-legends',
|
||||
aliases: ['league-of-legends-champion', 'league-of-legends-champ', 'league-champ'],
|
||||
aliases: ['league-of-legends-champion', 'league-of-legends-champ', 'league-champ', 'lol-champ'],
|
||||
group: 'search',
|
||||
memberName: 'league-of-legends',
|
||||
description: 'Responds with information on a League of Legends champion.',
|
||||
|
||||
@@ -57,7 +57,7 @@ module.exports = class MangaCommand extends Command {
|
||||
.setAuthor('AniList', 'https://i.imgur.com/iUIRC7v.png', 'https://anilist.co/')
|
||||
.setURL(`https://anilist.co/manga/${manga.id}`)
|
||||
.setThumbnail(manga.coverImage.large || null)
|
||||
.setTitle(manga.title.userPreferred)
|
||||
.setTitle(manga.title.english || manga.title.userPreferred)
|
||||
.setDescription(manga.description ? shorten(manga.description.replace(/(<br>)+/g, '\n')) : 'No description.')
|
||||
.addField('❯ Status', manga.status, true)
|
||||
.addField('❯ Chapters / Volumes', `${manga.chapters || '???'}/${manga.volumes || '???'}`, true)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "98.4.1",
|
||||
"version": "99.0.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user