mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
What Anime now supports up to 10MB images
This commit is contained in:
@@ -36,7 +36,7 @@ module.exports = class WhatAnimeCommand extends Command {
|
|||||||
}
|
}
|
||||||
const { body } = await request.get(screenshot);
|
const { body } = await request.get(screenshot);
|
||||||
const result = await this.search(body, msg.channel.nsfw);
|
const result = await this.search(body, msg.channel.nsfw);
|
||||||
if (result === 'size') return msg.reply('Please do not send an image larger than 1MB.');
|
if (result === 'size') return msg.reply('Please do not send an image larger than 10MB.');
|
||||||
if (result.nsfw) return msg.reply('This is from a hentai, and this isn\'t an NSFW channel, pervert.');
|
if (result.nsfw) return msg.reply('This is from a hentai, and this isn\'t an NSFW channel, pervert.');
|
||||||
return msg.reply(
|
return msg.reply(
|
||||||
`I'm ${result.prob}% sure this is from ${result.title}${result.episode
|
`I'm ${result.prob}% sure this is from ${result.title}${result.episode
|
||||||
@@ -61,7 +61,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+7) return 'size';
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.post('https://trace.moe/api/search')
|
.post('https://trace.moe/api/search')
|
||||||
.query({ token: WHATANIME_KEY })
|
.query({ token: WHATANIME_KEY })
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "107.7.1",
|
"version": "107.7.2",
|
||||||
"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