Add message if probablity is low in what-anime

This commit is contained in:
Dragon Fire
2020-03-07 18:35:13 -05:00
parent 8692dcbf9f
commit e0d131f394
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "112.2.2",
"version": "112.2.3",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {