Fix reporting WhatAnime errors

This commit is contained in:
blank X 2021-01-14 20:07:06 +07:00
parent aff43c5a1a
commit 7f7c70464d
1 changed files with 2 additions and 2 deletions

View File

@ -34,9 +34,9 @@ async def whatanime(client, message):
await reply.edit_text('Uploading...') await reply.edit_text('Uploading...')
with open(new_path, 'rb') as file: with open(new_path, 'rb') as file:
async with session.post('https://trace.moe/api/search', data={'image': file}) as resp: async with session.post('https://trace.moe/api/search', data={'image': file}) as resp:
json = await resp.json() json = await resp.json(content_type=None)
if isinstance(json, str): if isinstance(json, str):
await reply.edit_text(html.escape(json)) await reply.edit_text(json, parse_mode=None)
else: else:
try: try:
match = json['docs'][0] match = json['docs'][0]