mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
Fix what-anime
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'what-anime',
|
name: 'what-anime',
|
||||||
aliases: ['whatanime.ga', 'anime-source', 'anime-sauce', 'weeb-sauce'],
|
aliases: ['whatanime-ga', 'anime-source', 'anime-sauce', 'weeb-sauce', 'trace-moe'],
|
||||||
group: 'analyze',
|
group: 'analyze',
|
||||||
memberName: 'what-anime',
|
memberName: 'what-anime',
|
||||||
description: 'Determines what anime a screenshot is from.',
|
description: 'Determines what anime a screenshot is from.',
|
||||||
@@ -46,7 +46,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
async fetchRateLimit() {
|
async fetchRateLimit() {
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get('https://whatanime.ga/api/me')
|
.get('https://trace.moe/api/me')
|
||||||
.query({ token: WHATANIME_KEY });
|
.query({ token: WHATANIME_KEY });
|
||||||
return { status: body.quota > 0, refresh: body.quota_ttl };
|
return { status: body.quota > 0, refresh: body.quota_ttl };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -57,7 +57,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
async search(file) {
|
async search(file) {
|
||||||
if (Buffer.byteLength(file) > 1e+6) return 'size';
|
if (Buffer.byteLength(file) > 1e+6) return 'size';
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.post('https://whatanime.ga/api/search')
|
.post('https://trace.moe/api/search')
|
||||||
.query({ token: WHATANIME_KEY })
|
.query({ token: WHATANIME_KEY })
|
||||||
.attach('image', base64(file));
|
.attach('image', base64(file));
|
||||||
const data = body.docs[0];
|
const data = body.docs[0];
|
||||||
@@ -73,7 +73,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
async fetchPreview(data) {
|
async fetchPreview(data) {
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get('https://whatanime.ga/preview.php')
|
.get('https://trace.moe/preview.php')
|
||||||
.query({
|
.query({
|
||||||
anilist_id: data.anilist_id,
|
anilist_id: data.anilist_id,
|
||||||
file: data.filename,
|
file: data.filename,
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "95.1.10",
|
"version": "95.1.11",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user