From c94de918e9cd2daa89d72c78dd8920e06aeb36cf Mon Sep 17 00:00:00 2001 From: Chenric <91937041+ChenXu233@users.noreply.github.com> Date: Sat, 28 Sep 2024 09:24:29 +0800 Subject: [PATCH] =?UTF-8?q?:alembic:=20=E6=B5=8B=E8=AF=95=E9=80=9F?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_dialectlist/__init__.py | 4 +++- nonebot_plugin_dialectlist/config.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nonebot_plugin_dialectlist/__init__.py b/nonebot_plugin_dialectlist/__init__.py index 631b17b..02a2a3a 100644 --- a/nonebot_plugin_dialectlist/__init__.py +++ b/nonebot_plugin_dialectlist/__init__.py @@ -224,7 +224,9 @@ async def handle_rank( await saa.Text("没有指定群哦").finish() if plugin_config.counting_cache: + t1 = t.time() raw_rank = await get_cache(start, stop, id) + logger.debug(f"获取计数消息花费时间:{t.time() - t1}") else: t1 = t.time() messages = await get_message_records( @@ -237,8 +239,8 @@ async def handle_rank( time_stop=stop, exclude_id1s=plugin_config.excluded_people, ) - logger.debug(f"获取计数消息花费时间:{t.time() - t1}") raw_rank = msg_counter(messages) + logger.debug(f"获取计数消息花费时间:{t.time() - t1}") if not raw_rank: await saa.Text("明明这个时间段都没有人说话怎么会有话痨榜呢?").finish() diff --git a/nonebot_plugin_dialectlist/config.py b/nonebot_plugin_dialectlist/config.py index 69703c4..6b42148 100644 --- a/nonebot_plugin_dialectlist/config.py +++ b/nonebot_plugin_dialectlist/config.py @@ -6,10 +6,10 @@ from nonebot import get_driver, get_plugin_config class ScopedConfig(BaseModel): get_num: int = 5 # 获取人数数量 font: str = "SimHei" # 字体格式 - suffix: bool = False # 是否显示后缀 + suffix: bool = True # 是否显示后缀 excluded_self: bool = True # 是否排除自己 visualization: bool = True # 是否可视化 - counting_cache: bool = True # 计数缓存(能够提高回复速度) + counting_cache: bool = False # 计数缓存(能够提高回复速度) excluded_people: List[str] = [] # 排除的人的QQ号 timezone: Optional[str] = "Asia/Shanghai" # 时区,影响统计时间 string_suffix: str = "统计花费时间:{timecost}秒" # 消息格式后缀