From 351ed0b06393a3e7571ecb086f2af06a976a6f1d Mon Sep 17 00:00:00 2001 From: K2cr2O1 <2221577113@qq.com> Date: Sat, 24 Jan 2026 20:50:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4py=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E7=9A=84ADMIN=E6=9D=83=E9=99=90=E9=99=90=E5=88=B6=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=B9=E5=AE=9A=E4=BA=8B=E4=BB=B6ID?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除code_py.py中py命令的ADMIN权限限制,使其对所有用户可用 在jrcd.py中为handle_jrcd和handle_bbcd命令添加对特定事件ID(831797331)的过滤 --- plugins/code_py.py | 2 +- plugins/jrcd.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/code_py.py b/plugins/code_py.py index 5f241b2..ab8f0ac 100644 --- a/plugins/code_py.py +++ b/plugins/code_py.py @@ -141,7 +141,7 @@ def normalize_code(code: str) -> str: return code.strip() -@matcher.command("py", "python", "code_py", permission=Permission.ADMIN) +@matcher.command("py", "python", "code_py") async def code_py_main(event: MessageEvent, args: list[str]): """ /py 命令的主入口。 diff --git a/plugins/jrcd.py b/plugins/jrcd.py index c671315..d8555f0 100644 --- a/plugins/jrcd.py +++ b/plugins/jrcd.py @@ -12,6 +12,8 @@ from core.managers.command_manager import matcher from core.managers.redis_manager import redis_manager from core.utils.executor import run_in_thread_pool from models.events.message import MessageEvent, MessageSegment +from core.utils.logger import logger + __plugin_meta__ = { "name": "jrcd", @@ -71,6 +73,8 @@ def get_jrcd(user_id: int) -> int: @matcher.command("jrcd") async def handle_jrcd(bot: Bot, event: MessageEvent, args: list[str]): + if event.id == 831797331: + return None """ 处理 jrcd 指令,回复用户的“今日长度”。 @@ -125,6 +129,8 @@ async def handle_jrcd_stats(bot: Bot, event: MessageEvent, args: list[str]): @matcher.command("bbcd") async def handle_bbcd(bot: Bot, event: MessageEvent, args: list[str]): + if event.id == 831797331: + return None """ 处理 bbcd 指令,比较两位用户的“长度”。