mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 08:19:08 +02:00
Add message if probablity is low in what-anime
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { base64 } = require('../../util/Util');
|
||||
const { WHATANIME_KEY } = process.env;
|
||||
|
||||
@@ -42,12 +43,11 @@ module.exports = class WhatAnimeCommand extends Command {
|
||||
if (result.nsfw && !msg.channel.nsfw) {
|
||||
return msg.reply('This is from a hentai, and this isn\'t an NSFW channel, pervert.');
|
||||
}
|
||||
return msg.reply(
|
||||
`I'm ${result.prob}% sure this is from ${result.title}${result.episode
|
||||
? ` episode ${result.episode}`
|
||||
: ''}.`,
|
||||
result.preview ? { files: [{ attachment: result.preview, name: 'preview.mp4' }] } : {}
|
||||
);
|
||||
const title = `${result.title}${result.episode ? ` episode ${result.episode}` : ''}`;
|
||||
return msg.reply(stripIndents`
|
||||
I'm ${result.prob}% sure this is from ${title}.
|
||||
${result.prob < 90 ? '_This probablity is rather low, try using a higher quality image._' : ''}
|
||||
`, result.preview ? { files: [{ attachment: result.preview, name: 'preview.mp4' }] } : {});
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "112.2.2",
|
||||
"version": "112.2.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user