mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +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":
|
if event.message_type == "group":
|
||||||
permission = "MEMBER"
|
permission = "MEMBER"
|
||||||
|
|
||||||
if event.sender["role"] == "admin":
|
if "role" in event.sender:
|
||||||
permission = "ADMINISTRATOR"
|
if event.sender["role"] == "admin":
|
||||||
elif event.sender["role"] == "owner":
|
permission = "ADMINISTRATOR"
|
||||||
permission = "OWNER"
|
elif event.sender["role"] == "owner":
|
||||||
|
permission = "OWNER"
|
||||||
converted_event = mirai.GroupMessage(
|
converted_event = mirai.GroupMessage(
|
||||||
sender=mirai.models.entities.GroupMember(
|
sender=mirai.models.entities.GroupMember(
|
||||||
id=event.sender["user_id"], # message_seq 放哪?
|
id=event.sender["user_id"], # message_seq 放哪?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user