mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +08:00
Merge pull request #888 from Tigrex-Dai/master
fix: 添加了针对报错内容对event.sender中'role'的存在性检查
This commit is contained in:
commit
3c2db5097a
|
@ -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