From 322ad1988972da7e0393f334ca527396a6658ff1 Mon Sep 17 00:00:00 2001 From: Expliyh Date: Fri, 17 May 2024 14:18:55 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=9C=A8=E4=BD=BF=E7=94=A8=20satori=20?= =?UTF-8?q?=E6=97=B6=E9=83=A8=E5=88=86=E6=8C=87=E4=BB=A4=E6=97=A0=E5=93=8D?= =?UTF-8?q?=E5=BA=94=20:bug:=20=E4=BD=BF=E7=94=A8=20onebot=20=E6=97=B6?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BA=8B=E4=BB=B6=E5=9C=A8=20postprocessor?= =?UTF-8?q?=20=E9=98=B6=E6=AE=B5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/liteyuki_statistics/stat_monitors.py | 14 +++++++++----- liteyuki/utils/base/ly_typing.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/liteyuki/plugins/liteyuki_statistics/stat_monitors.py b/liteyuki/plugins/liteyuki_statistics/stat_monitors.py index 63b20009..f66f15c4 100644 --- a/liteyuki/plugins/liteyuki_statistics/stat_monitors.py +++ b/liteyuki/plugins/liteyuki_statistics/stat_monitors.py @@ -14,14 +14,17 @@ from liteyuki.utils import satori_utils require("nonebot_plugin_alconna") -@event_postprocessor async def general_event_monitor(bot: T_Bot, event: T_MessageEvent): - if isinstance(bot, satori.Bot): - return await satori_event_monitor(bot, event) - elif isinstance(bot, v11.Bot): - return await onebot_v11_event_monitor(bot, event) + print("POST PROCESS") + # if isinstance(bot, satori.Bot): + # print("POST PROCESS SATORI EVENT") + # return await satori_event_monitor(bot, event) + # elif isinstance(bot, v11.Bot): + # print("POST PROCESS V11 EVENT") + # return await onebot_v11_event_monitor(bot, event) +@event_postprocessor async def onebot_v11_event_monitor(bot: v11.Bot, event: v11.MessageEvent): if event.message_type == "group": event: v11.GroupMessageEvent @@ -44,6 +47,7 @@ async def onebot_v11_event_monitor(bot: v11.Bot, event: v11.MessageEvent): msg_db.save(mem) +@event_postprocessor async def satori_event_monitor(bot: satori.Bot, event: satori.MessageEvent): if event.guild is not None: event: satori.MessageEvent diff --git a/liteyuki/utils/base/ly_typing.py b/liteyuki/utils/base/ly_typing.py index c13ce309..31242e18 100644 --- a/liteyuki/utils/base/ly_typing.py +++ b/liteyuki/utils/base/ly_typing.py @@ -4,5 +4,5 @@ from nonebot.adapters import satori T_Bot = v11.Bot | v12.Bot | satori.Bot T_GroupMessageEvent = v11.GroupMessageEvent | v12.GroupMessageEvent T_PrivateMessageEvent = v11.PrivateMessageEvent | v12.PrivateMessageEvent -T_MessageEvent = v11.MessageEvent | v12.MessageEvent # | satori.MessageEvent +T_MessageEvent = v11.MessageEvent | v12.MessageEvent | satori.MessageEvent T_Message = v11.Message | v12.Message | satori.Message