From 833cdb4a751126817a9128462ac48fffbc8ce393 Mon Sep 17 00:00:00 2001 From: XuChenXu <91937041+ChenXu233@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:16:37 +0800 Subject: [PATCH] =?UTF-8?q?:lipstick:=20=E8=BF=98=E6=98=AF=E4=BA=BA?= =?UTF-8?q?=E6=80=A7=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_dialectlist/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_dialectlist/__init__.py b/nonebot_plugin_dialectlist/__init__.py index e1996c6..ec92208 100644 --- a/nonebot_plugin_dialectlist/__init__.py +++ b/nonebot_plugin_dialectlist/__init__.py @@ -5,6 +5,7 @@ require("nonebot_plugin_apscheduler") require("nonebot_plugin_htmlrender") require("nonebot_plugin_userinfo") require("nonebot_plugin_alconna") +require("nonebot_plugin_uninfo") require("nonebot_plugin_cesaa") import re @@ -33,6 +34,7 @@ from nonebot_plugin_alconna import ( ) from nonebot_plugin_chatrecorder import get_message_records from nonebot_plugin_session import Session, SessionIdType, extract_session +from nonebot_plugin_uninfo import Uninfo from .storage import get_cache, build_cache from .config import Config, plugin_config @@ -104,6 +106,7 @@ async def handle_b_cmd( at:Match[str|At], group_id: Match[str], keyword: Match[str], + uninfo: Uninfo, session: Session = Depends(extract_session), ): id = at.result @@ -134,9 +137,9 @@ async def handle_b_cmd( d = msg_counter(messages, keywords) rank = got_rank(d) if not rank: - await b_cmd.finish(f"该用户在群{gid}关于{keyword}的B话数量为0。") + await b_cmd.finish(f"该用户在群“{uninfo.scene.name}”关于“{keyword}”的B话数量为0。") - await saa.Text(f"该用户在群{gid}关于{keyword}的B话数量为{rank[0][1]}。").send(reply=True) + await saa.Text(f"该用户在群“{uninfo.scene.name}”关于“{keyword}”的B话数量为{rank[0][1]}。").send(reply=True) rank_cmd = on_alconna(