From e0d131f394081d0ace16c55546f53600f0e50a54 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 7 Mar 2020 18:35:13 -0500 Subject: [PATCH] Add message if probablity is low in what-anime --- commands/analyze/what-anime.js | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/commands/analyze/what-anime.js b/commands/analyze/what-anime.js index 739b85d8..d87593a6 100644 --- a/commands/analyze/what-anime.js +++ b/commands/analyze/what-anime.js @@ -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!`); } diff --git a/package.json b/package.json index 1bf7f564..299b8736 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "112.2.2", + "version": "112.2.3", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {