mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Update what-anime with new features
This commit is contained in:
@@ -46,7 +46,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
const title = `${result.title}${result.episode ? ` episode ${result.episode}` : ''}`;
|
const title = `${result.title}${result.episode ? ` episode ${result.episode}` : ''}`;
|
||||||
return msg.reply(stripIndents`
|
return msg.reply(stripIndents`
|
||||||
I'm ${result.prob}% sure this is from ${title}.
|
I'm ${result.prob}% sure this is from ${title}.
|
||||||
${result.prob < 87 ? '_This probablity is rather low, try using a higher quality image._' : ''}
|
${result.prob < 90 ? '_This probablity is rather low, try using a higher quality image._' : ''}
|
||||||
`, result.preview ? { files: [{ attachment: result.preview, name: 'preview.mp4' }] } : {});
|
`, result.preview ? { files: [{ attachment: result.preview, name: 'preview.mp4' }] } : {});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
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!`);
|
||||||
@@ -56,7 +56,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
async fetchRateLimit() {
|
async fetchRateLimit() {
|
||||||
try {
|
try {
|
||||||
const { body } = await request.get('https://trace.moe/api/me');
|
const { body } = await request.get('https://trace.moe/api/me');
|
||||||
return { status: body.quota > 0, refresh: body.quota_ttl };
|
return { status: body.limit > 0, refresh: body.limit_ttl };
|
||||||
} catch {
|
} catch {
|
||||||
return { status: false, refresh: Infinity };
|
return { status: false, refresh: Infinity };
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,9 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
.get(`https://media.trace.moe/video/${data.anilist_id}/${encodeURIComponent(data.filename)}`)
|
.get(`https://media.trace.moe/video/${data.anilist_id}/${encodeURIComponent(data.filename)}`)
|
||||||
.query({
|
.query({
|
||||||
t: data.at,
|
t: data.at,
|
||||||
token: data.tokenthumb
|
token: data.tokenthumb,
|
||||||
|
mute: true,
|
||||||
|
size: 's'
|
||||||
});
|
});
|
||||||
return body;
|
return body;
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "128.3.0",
|
"version": "128.3.1",
|
||||||
"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