fix full screen error when not connect to bot

This commit is contained in:
felinae98 2022-02-18 10:33:30 +08:00
parent fd7acea51a
commit 5eac7795d1
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -47,11 +47,13 @@ async def fetch_and_send(target_type: str):
send_user_list,
)
)
bot = nonebot.get_bot()
assert isinstance(bot, Bot)
to_send = await platform_manager[target_type].fetch_new_post(
target, send_userinfo_list
)
if not to_send:
return
bot = nonebot.get_bot()
assert isinstance(bot, Bot)
for user, send_list in to_send:
for send_post in send_list:
logger.info("send to {}: {}".format(user, send_post))