Skip to content

Commit

Permalink
chore(qqapi): adapt new api
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Nov 23, 2023
1 parent 150d77f commit 6a50eb3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .mina/qqapi.toml
Original file line number Diff line number Diff line change
@@ -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"
]

Expand Down
26 changes: 25 additions & 1 deletion avilla/qqapi/perform/event/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

0 comments on commit 6a50eb3

Please sign in to comment.