From 6a50eb3163986de4ad885c231ad710b62d0b1d66 Mon Sep 17 00:00:00 2001 From: RF-Tar-Railt <3165388245@qq.com> Date: Thu, 23 Nov 2023 14:47:40 +0800 Subject: [PATCH] chore(qqapi): adapt new api --- .mina/qqapi.toml | 2 +- avilla/qqapi/perform/event/message.py | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.mina/qqapi.toml b/.mina/qqapi.toml index 6bf3220f..087e7323 100644 --- a/.mina/qqapi.toml +++ b/.mina/qqapi.toml @@ -1,6 +1,6 @@ includes = ["avilla/qqapi"] raw_dependencies = [ - "avilla-core >= 1.0.0a14", + "avilla-core >= 1.0.0a15", "avilla-standard-qq >= 1.0.0a7" ] diff --git a/avilla/qqapi/perform/event/message.py b/avilla/qqapi/perform/event/message.py index 259a1374..546d758b 100644 --- a/avilla/qqapi/perform/event/message.py +++ b/avilla/qqapi/perform/event/message.py @@ -314,10 +314,22 @@ async def public_message_delete(self, event_type: ..., raw_event: dict): context = Context( account, operator, - channel, + author, channel, channel.member(account_route["account"]), ) + context._collect_metadatas( + author, + Nick( + raw_event["message"]["author"]["username"], + raw_event["message"]["author"]["username"], + None + ), + Summary( + raw_event["message"]["author"]["username"], + "channel member" + ), + ) return MessageRevoked(context, author.message(raw_event["message"]["id"]), operator) @m.entity(QQAPICapability.event_callback, event_type="direct_message_delete") @@ -338,4 +350,16 @@ async def direct_message_delete(self, event_type: ..., raw_event: dict): author, account_route, ) + context._collect_metadatas( + author, + Nick( + raw_event["message"]["author"]["username"], + raw_event["message"]["author"]["username"], + None + ), + Summary( + raw_event["message"]["author"]["username"], + "channel member" + ), + ) return MessageRevoked(context, author.message(raw_event["message"]["id"]), operator)