Fix: Check info_list to avoid TypeError

This commit is contained in:
Ailitonia 2021-09-07 02:08:56 +08:00 committed by GitHub
parent 5eb64060dc
commit 7db5b3b5c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,6 +131,8 @@ async def _(bot: Bot, event: MessageEvent, state: T_State):
info_list, code = await search_pixiv_urls(keyword, num, page, r18)
if code != 200:
await pixiv_keyword.finish(info_list[0])
if not info_list:
await pixiv_keyword.finish("没有找到啊,等等再试试吧~V", at_sender=True)
await send_image(info_list, pixiv_keyword, bot, event)
logger.info(
f"(USER {event.user_id}, GROUP {event.group_id if isinstance(event, GroupMessageEvent) else 'private'})"