Fix some things

This commit is contained in:
blank X 2020-12-24 21:58:18 +07:00
parent 5f3f92a7fc
commit eeb8ed0cc2
1 changed files with 4 additions and 2 deletions

View File

@ -87,13 +87,15 @@ async def saucenao(client, message):
await download_file(result['header']['thumbnail'], filename) await download_file(result['header']['thumbnail'], filename)
to_image = True to_image = True
atext += '\n\n' atext += '\n\n'
if len((await client.parser.parse(caption + atext))['message']) <= 1024: if len((await client.parser.parse(caption + atext, 'html'))['message']) <= 1024:
caption += atext caption += atext
text += atext text += atext
try: try:
await message.reply_photo(filename, caption=caption) await message.reply_photo(filename, caption=caption)
except Exception: except Exception:
await message.reply_text(text) await reply.edit_text(text)
else:
await reply.delete()
help_dict['saucenao'] = ('saucenao', help_dict['saucenao'] = ('saucenao',
'''{prefix}saucenao <i>(as caption of Photo/GIF/Video/Sticker or reply)</i> - Reverse searches anime art, thanks to saucenao.com '''{prefix}saucenao <i>(as caption of Photo/GIF/Video/Sticker or reply)</i> - Reverse searches anime art, thanks to saucenao.com