From f6dc332e17783acd9c57bcacc33c82ef711e694b Mon Sep 17 00:00:00 2001 From: ATRI Date: Wed, 8 Jul 2026 11:53:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F=EF=BC=9A=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20@filter.command=20=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=B3=A8=E5=85=A5=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skills/atri_cf_query_plugin.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ATRI My Dear Moments/skills/atri_cf_query_plugin.py b/ATRI My Dear Moments/skills/atri_cf_query_plugin.py index 57ef8b6..b1c9f41 100644 --- a/ATRI My Dear Moments/skills/atri_cf_query_plugin.py +++ b/ATRI My Dear Moments/skills/atri_cf_query_plugin.py @@ -267,13 +267,12 @@ class CFQueryPlugin(Star): # ========== 绑定 ========== @filter.command("cfbind") - async def cf_bind(self, event: AstrMessageEvent): + async def cf_bind(self, event: AstrMessageEvent, handle: str = None): """绑定CF账号:cfbind <用户名>""" - args = event.get_args() - if not args: + if not handle: yield event.plain_result("❌ 用法: cfbind ") return - handle = args[0].strip() + handle = handle.strip() info = _query_user_info(handle) if not info: yield event.plain_result(f"❌ CF用户 {handle} 不存在,请检查用户名") @@ -338,13 +337,9 @@ class CFQueryPlugin(Star): # ========== 主查询 ========== @filter.command("cf") - async def cf_query(self, event: AstrMessageEvent): + async def cf_query(self, event: AstrMessageEvent, handle: str = None): """查询CF用户:cf <用户名> 或 cf(查已绑定)""" - args = event.get_args() - handle = None - if args: - handle = args[0].strip() - else: + if not handle: uid = str(event.get_sender_id()) bindings = _load_bindings() if uid in bindings: