mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-15 19:22:24 +08:00
Update aiocqhttp.py
针对报错对"role"做存在性检查
This commit is contained in:
parent
ee0d6dcdae
commit
ce56f79687
|
@ -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 放哪?
|
||||
|
|
Loading…
Reference in New Issue
Block a user