Merge pull request #888 from Tigrex-Dai/master

fix: 添加了针对报错内容对event.sender中'role'的存在性检查
This commit is contained in:
Junyan Qin 2024-09-22 16:50:55 +08:00 committed by GitHub
commit 3c2db5097a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,10 +173,11 @@ class AiocqhttpEventConverter(adapter.EventConverter):
if event.message_type == "group":
permission = "MEMBER"
if event.sender["role"] == "admin":
permission = "ADMINISTRATOR"
elif event.sender["role"] == "owner":
permission = "OWNER"
if "role" in event.sender:
if event.sender["role"] == "admin":
permission = "ADMINISTRATOR"
elif event.sender["role"] == "owner":
permission = "OWNER"
converted_event = mirai.GroupMessage(
sender=mirai.models.entities.GroupMember(
id=event.sender["user_id"], # message_seq 放哪?