Skip to content

Commit

Permalink
Merge pull request #888 from Tigrex-Dai/master
Browse files Browse the repository at this point in the history
fix: 添加了针对报错内容对event.sender中'role'的存在性检查
  • Loading branch information
RockChinQ authored Sep 22, 2024
2 parents ee0d6dc + ce56f79 commit 3c2db50
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/platform/sources/aiocqhttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ def target2yiri(event: aiocqhttp.Event):
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 放哪?
Expand Down

0 comments on commit 3c2db50

Please sign in to comment.