From df58ff7df0aadb07adf08a69165453803d31c6cd Mon Sep 17 00:00:00 2001 From: LoCCai <105721394+LoCCai@users.noreply.github.com> Date: Wed, 10 Dec 2025 17:24:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=BA=E8=AE=BE?= =?UTF-8?q?=E7=83=AD=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_random_reply/__init__.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_random_reply/__init__.py b/nonebot_plugin_random_reply/__init__.py index 7c1308d..595eb92 100644 --- a/nonebot_plugin_random_reply/__init__.py +++ b/nonebot_plugin_random_reply/__init__.py @@ -15,6 +15,7 @@ import random import httpx import nonebot +from nonebot.permission import SUPERUSER from nonebot.plugin import PluginMetadata @@ -176,6 +177,20 @@ def load_plugin_config(file_path: str): prompt = load_plugin_config(plugin_config.reply_prompt_url) logger.info("随机回复插件使用prompt:"+ prompt) +reload_prompt = on_command("重载七七人设", block=True, priority=1,permission=SUPERUSER) +@reload_prompt.handle() +async def _( + bot: Bot, event: GroupMessageEvent, user_info: UserInfo = BotUserInfo() +): + try: + global prompt + prompt = load_plugin_config(plugin_config.reply_prompt_url) + logger.info("随机回复插件使用prompt:"+ prompt) + except Exception as e: + logger.error("随机回复插件切换prompt出错:" + str(e)) + Text("随机回复插件切换prompt出错").finish() + + await Text("随机回复插件切换prompt成功").finish() async def random_rule(event: GroupMessageEvent) -> bool: group_id = str(event.group_id) @@ -367,6 +382,6 @@ async def _( balance = await get_current_balance(plugin_config.oneapi_key) except Exception as e: logger.error("获取余额出错" + str(e)) - Text("获取余额出错").finish() + Text("获取余额出错")。finish() - await Text("当前余额为:" + str(balance)).finish() \ No newline at end of file + await Text("当前余额为:" + str(balance))。finish() From 65900c3e07976b8290ebf7db7d644c2e055229aa Mon Sep 17 00:00:00 2001 From: LoCCai <105721394+LoCCai@users.noreply.github.com> Date: Wed, 10 Dec 2025 17:25:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=83=AD=E9=87=8D=E8=BD=BD=E4=BA=BA?= =?UTF-8?q?=E8=AE=BEprompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_random_reply/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_random_reply/__init__.py b/nonebot_plugin_random_reply/__init__.py index 595eb92..bc63128 100644 --- a/nonebot_plugin_random_reply/__init__.py +++ b/nonebot_plugin_random_reply/__init__.py @@ -32,7 +32,7 @@ usage=""" 配置好后bot随机攻击群友,@机器人也可触发 余额查询————开启硅基流动余额预警后,使用该命令可以查询API余额 - """, + """, config=Config, extra={}, type="application", @@ -177,7 +177,7 @@ def load_plugin_config(file_path: str): prompt = load_plugin_config(plugin_config.reply_prompt_url) logger.info("随机回复插件使用prompt:"+ prompt) -reload_prompt = on_command("重载七七人设", block=True, priority=1,permission=SUPERUSER) +reload_prompt = on_command("重载人设", block=True, priority=1,permission=SUPERUSER) @reload_prompt.handle() async def _( bot: Bot, event: GroupMessageEvent, user_info: UserInfo = BotUserInfo()