Update aiocqhttp.py

针对报错对"role"做存在性检查
This commit is contained in:
Tigrex Dai 2024-09-22 15:39:48 +08:00 committed by GitHub
parent ee0d6dcdae
commit ce56f79687
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,6 +173,7 @@ class AiocqhttpEventConverter(adapter.EventConverter):
if event.message_type == "group": if event.message_type == "group":
permission = "MEMBER" permission = "MEMBER"
if "role" in event.sender:
if event.sender["role"] == "admin": if event.sender["role"] == "admin":
permission = "ADMINISTRATOR" permission = "ADMINISTRATOR"
elif event.sender["role"] == "owner": elif event.sender["role"] == "owner":