From b67926c83a3999156c055be4c1956fd5938a6e80 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 23 Sep 2023 11:37:40 +0800 Subject: [PATCH] fix: from_user none type --- plugins/chat_member_update.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/chat_member_update.py b/plugins/chat_member_update.py index c054e66..80ad730 100644 --- a/plugins/chat_member_update.py +++ b/plugins/chat_member_update.py @@ -23,7 +23,6 @@ ADMIN_MSG = """管理员邀请,自动放行。""" @bot.on_chat_member_updated() async def invite(client: Client, chat_member_updated: ChatMemberUpdated): chat = chat_member_updated.chat - old_chat_member = chat_member_updated.old_chat_member if await cache.get(f"cid:{chat.id}"): return member = chat_member_updated.new_chat_member @@ -60,7 +59,7 @@ async def invite(client: Client, chat_member_updated: ChatMemberUpdated): from_user = chat_member_updated.from_user if from_user and from_user.id == user.id: from_user = None - if from_user.is_self: + if from_user and from_user.is_self: return if ( user