mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +02:00
Various Fixes
This commit is contained in:
@@ -260,7 +260,7 @@ in the appropriate channel's topic to use it.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Total: 575
|
Total: 576
|
||||||
|
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
@@ -465,6 +465,7 @@ Total: 575
|
|||||||
|
|
||||||
### Search:
|
### Search:
|
||||||
|
|
||||||
|
* **anilist:** Responds with user information for an Anilist user.
|
||||||
* **anime-character:** Searches AniList for your query, getting character results.
|
* **anime-character:** Searches AniList for your query, getting character results.
|
||||||
* **anime-staff:** Searches AniList for your query, getting staff results.
|
* **anime-staff:** Searches AniList for your query, getting staff results.
|
||||||
* **anime:** Searches AniList for your query, getting anime results.
|
* **anime:** Searches AniList for your query, getting anime results.
|
||||||
@@ -967,6 +968,7 @@ here.
|
|||||||
- [Andrew Tyler](https://www.dafont.com/andrew-tyler.d2526)
|
- [Andrew Tyler](https://www.dafont.com/andrew-tyler.d2526)
|
||||||
* achievement ([Minecraftia Font](https://www.dafont.com/minecraftia.font))
|
* achievement ([Minecraftia Font](https://www.dafont.com/minecraftia.font))
|
||||||
- [AniList](https://anilist.co/)
|
- [AniList](https://anilist.co/)
|
||||||
|
* anilist ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
||||||
* anime ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
* anime ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
||||||
* anime-airing ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
* anime-airing ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
||||||
* anime-character ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
* anime-character ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
|
||||||
@@ -1158,8 +1160,6 @@ here.
|
|||||||
* rename-all (Concept)
|
* rename-all (Concept)
|
||||||
- [Genderize.io](https://genderize.io/)
|
- [Genderize.io](https://genderize.io/)
|
||||||
* gender (API)
|
* gender (API)
|
||||||
- [Gerhard Jordan](http://www.gerhardjordan.com/)
|
|
||||||
* never-have-i-ever ([Statement Data](http://www.neverhaveiever.org/))
|
|
||||||
- [gfauchart](https://github.com/gfauchart)
|
- [gfauchart](https://github.com/gfauchart)
|
||||||
* adorable ([API](https://github.com/adorableio/avatars-api-middleware/issues/108))
|
* adorable ([API](https://github.com/adorableio/avatars-api-middleware/issues/108))
|
||||||
- [GIPHY](https://giphy.com/)
|
- [GIPHY](https://giphy.com/)
|
||||||
@@ -1589,6 +1589,8 @@ here.
|
|||||||
* pornhub (Video Data)
|
* pornhub (Video Data)
|
||||||
- [Pottermore](https://my.pottermore.com/sorting)
|
- [Pottermore](https://my.pottermore.com/sorting)
|
||||||
* sorting-hat (Original Quiz)
|
* sorting-hat (Original Quiz)
|
||||||
|
- [PsyCat Games](https://psycatgames.com/)
|
||||||
|
* never-have-i-ever ([Statement Data](https://psycatgames.com/app/never-have-i-ever/))
|
||||||
- [PSYCHO-PASS](http://psycho-pass.com/)
|
- [PSYCHO-PASS](http://psycho-pass.com/)
|
||||||
* psycho-pass (Original Anime)
|
* psycho-pass (Original Anime)
|
||||||
- [Psycho-Pass Wiki](https://psychopass.fandom.com/wiki/Psycho-Pass_Wiki)
|
- [Psycho-Pass Wiki](https://psychopass.fandom.com/wiki/Psycho-Pass_Wiki)
|
||||||
@@ -1748,7 +1750,7 @@ here.
|
|||||||
* ai-artwork (API)
|
* ai-artwork (API)
|
||||||
- [This Cat Does Not Exist](https://thiscatdoesnotexist.com/)
|
- [This Cat Does Not Exist](https://thiscatdoesnotexist.com/)
|
||||||
* ai-cat (API)
|
* ai-cat (API)
|
||||||
- [This Fursona Does Not Exist](https://thisfursonadoesnotexist.com/)
|
- [This Fursona Does Not Exist](http://thisfursonadoesnotexist.com/)
|
||||||
* ai-fursona (API)
|
* ai-fursona (API)
|
||||||
- [This Horse Does Not Exist](https://thishorsedoesnotexist.com/)
|
- [This Horse Does Not Exist](https://thishorsedoesnotexist.com/)
|
||||||
* ai-horse (API)
|
* ai-horse (API)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ module.exports = class AiFursonaCommand extends Command {
|
|||||||
credit: [
|
credit: [
|
||||||
{
|
{
|
||||||
name: 'This Fursona Does Not Exist',
|
name: 'This Fursona Does Not Exist',
|
||||||
url: 'https://thisfursonadoesnotexist.com/',
|
url: 'http://thisfursonadoesnotexist.com/',
|
||||||
reason: 'API'
|
reason: 'API'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -22,7 +22,7 @@ module.exports = class AiFursonaCommand extends Command {
|
|||||||
run(msg) {
|
run(msg) {
|
||||||
const num = Math.floor(Math.random() * 100000);
|
const num = Math.floor(Math.random() * 100000);
|
||||||
return msg.say(`AI-Generated Fursona #${num}`, {
|
return msg.say(`AI-Generated Fursona #${num}`, {
|
||||||
files: [`https://thisfursonadoesnotexist.com/v2/jpgs/seed${num.toString().padStart(5, '0')}.jpg`]
|
files: [`http://thisfursonadoesnotexist.com/v2/jpgs/seed${num.toString().padStart(5, '0')}.jpg`]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const request = require('node-superfetch');
|
const { safe, nsfw } = require('../../assets/json/never-have-i-ever');
|
||||||
|
const all = [...safe, ...nsfw];
|
||||||
|
|
||||||
module.exports = class NeverHaveIEverCommand extends Command {
|
module.exports = class NeverHaveIEverCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -11,21 +12,17 @@ module.exports = class NeverHaveIEverCommand extends Command {
|
|||||||
description: 'Responds with a random "Never Have I Ever..." statement.',
|
description: 'Responds with a random "Never Have I Ever..." statement.',
|
||||||
credit: [
|
credit: [
|
||||||
{
|
{
|
||||||
name: 'Gerhard Jordan',
|
name: 'PsyCat Games',
|
||||||
url: 'http://www.gerhardjordan.com/',
|
url: 'https://psycatgames.com/',
|
||||||
reason: 'Statement Data',
|
reason: 'Statement Data',
|
||||||
reasonURL: 'http://www.neverhaveiever.org/'
|
reasonURL: 'https://psycatgames.com/app/never-have-i-ever/'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg) {
|
async run(msg) {
|
||||||
try {
|
if (msg.channel.nsfw) return msg.say(all[Math.floor(Math.random() * all.length)]);
|
||||||
const { text } = await request.get('http://www.neverhaveiever.org/randomtext.php');
|
return msg.say(safe[Math.floor(Math.random() * safe.length)]);
|
||||||
return msg.say(text.match(/<h1>(.+)<\/h1>/i)[1].replaceAll('</br>', ''));
|
|
||||||
} catch (err) {
|
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const searchGraphQL = stripIndents`
|
||||||
|
query ($name: String) {
|
||||||
|
users: Page (perPage: 1) {
|
||||||
|
results: users (name: $name) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
module.exports = class AnilistCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'anilist',
|
||||||
|
aliases: ['anilist-user'],
|
||||||
|
group: 'search',
|
||||||
|
memberName: 'anilist',
|
||||||
|
description: 'Responds with user information for an Anilist user.',
|
||||||
|
clientPermissions: ['EMBED_LINKS'],
|
||||||
|
credit: [
|
||||||
|
{
|
||||||
|
name: 'AniList',
|
||||||
|
url: 'https://anilist.co/',
|
||||||
|
reason: 'API',
|
||||||
|
reasonURL: 'https://anilist.gitbook.io/anilist-apiv2-docs/'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'query',
|
||||||
|
prompt: 'What user would you like to get the information of?',
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg, { query }) {
|
||||||
|
try {
|
||||||
|
const data = await this.search(query);
|
||||||
|
if (!data || !data.id || !data.name) return msg.say('Could not find any results.');
|
||||||
|
return msg.say(`https://anilist.co/user/${data.name}`, { files: [`https://img.anili.st/user/${data.id}`] });
|
||||||
|
} catch (err) {
|
||||||
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async search(query) {
|
||||||
|
const { body } = await request
|
||||||
|
.post('https://graphql.anilist.co/')
|
||||||
|
.send({
|
||||||
|
variables: { search: query },
|
||||||
|
query: searchGraphQL
|
||||||
|
});
|
||||||
|
if (!body.data.users.results.length) return null;
|
||||||
|
return body.data.users.results[0];
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -79,7 +79,7 @@ module.exports = class AnimeCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'anime',
|
name: 'anime',
|
||||||
aliases: ['anilist-anime', 'anilist', 'ani', 'myanimelist', 'mal', 'mal-score'],
|
aliases: ['anilist-anime', 'ani', 'myanimelist', 'mal', 'mal-score'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'anime',
|
memberName: 'anime',
|
||||||
description: 'Searches AniList for your query, getting anime results.',
|
description: 'Searches AniList for your query, getting anime results.',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ const Command = require('../../structures/Command');
|
|||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const request = require('node-superfetch');
|
const request = require('node-superfetch');
|
||||||
|
const { decode: decodeHTML } = require('html-entities');
|
||||||
const { formatNumber, embedURL } = require('../../util/Util');
|
const { formatNumber, embedURL } = require('../../util/Util');
|
||||||
const { STACKOVERFLOW_KEY } = process.env;
|
const { STACKOVERFLOW_KEY } = process.env;
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ module.exports = class StackOverflowCommand extends Command {
|
|||||||
.setColor(0xF48023)
|
.setColor(0xF48023)
|
||||||
.setAuthor('Stack Overflow', 'https://i.imgur.com/P2jAgE3.png', 'https://stackoverflow.com/')
|
.setAuthor('Stack Overflow', 'https://i.imgur.com/P2jAgE3.png', 'https://stackoverflow.com/')
|
||||||
.setURL(data.link)
|
.setURL(data.link)
|
||||||
.setTitle(data.title)
|
.setTitle(decodeHTML(data.title))
|
||||||
.addField('❯ ID', data.question_id, true)
|
.addField('❯ ID', data.question_id, true)
|
||||||
.addField('❯ Asker', embedURL(data.owner.display_name, data.owner.link), true)
|
.addField('❯ Asker', embedURL(data.owner.display_name, data.owner.link), true)
|
||||||
.addField('❯ Views', formatNumber(data.view_count), true)
|
.addField('❯ Views', formatNumber(data.view_count), true)
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ module.exports = class TwitterCommand extends Command {
|
|||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.status === 401) await this.fetchToken();
|
if (err.status === 401) await this.fetchToken();
|
||||||
|
if (err.status === 403) return msg.say('This user is either private or suspended.');
|
||||||
if (err.status === 404) return msg.say('Could not find any results.');
|
if (err.status === 404) return msg.say('Could not find any results.');
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "124.5.7",
|
"version": "124.6.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -137,8 +137,10 @@ module.exports = class Pokemon {
|
|||||||
const versionGroup = move.version_group_details.find(mve => mve.version_group.name === this.moveSetVersion);
|
const versionGroup = move.version_group_details.find(mve => mve.version_group.name === this.moveSetVersion);
|
||||||
if (!versionGroup || !versionGroup.level_learned_at) continue;
|
if (!versionGroup || !versionGroup.level_learned_at) continue;
|
||||||
const { body: moveBody } = await request.get(move.move.url);
|
const { body: moveBody } = await request.get(move.move.url);
|
||||||
|
const name = moveBody.names.find(name => name.language.name === 'en').name;
|
||||||
|
if (this.moveSet.some(move => move.name === name)) continue;
|
||||||
this.moveSet.push({
|
this.moveSet.push({
|
||||||
name: moveBody.names.find(name => name.language.name === 'en').name,
|
name,
|
||||||
level: versionGroup.level_learned_at
|
level: versionGroup.level_learned_at
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user