diff --git a/commands/handlers.py b/commands/handlers.py index 0cf0942..7da19b6 100644 --- a/commands/handlers.py +++ b/commands/handlers.py @@ -825,12 +825,12 @@ def handle_perplexity_ask(ctx: 'MessageContext', match: Optional[Match]) -> bool def handle_reminder(ctx: 'MessageContext', match: Optional[Match]) -> bool: """处理来自私聊或群聊的 '提醒' 命令""" - # 2. 获取用户输入的提醒内容(现在包含"提醒"字样) - raw_text = match.group(1).strip() - if not raw_text or raw_text == "提醒": + # 2. 获取用户输入的提醒内容 (现在从完整消息获取) + raw_text = ctx.msg.content.strip() # 修改:从 ctx.msg.content 获取 + if not raw_text: # 修改:仅检查是否为空 # 在群聊中@用户回复 at_list = ctx.msg.sender if ctx.is_group else "" - ctx.send_text("请告诉我需要提醒什么内容和时间呀~ (例如:提醒 明天下午3点 开会 或 提醒我早上七点起床)", at_list) + ctx.send_text("请告诉我需要提醒什么内容和时间呀~ (例如:提醒我明天下午3点开会)", at_list) # 修改示例 return True # 3. 构造给 AI 的 Prompt diff --git a/commands/registry.py b/commands/registry.py index d3c5996..93a26b6 100644 --- a/commands/registry.py +++ b/commands/registry.py @@ -171,12 +171,12 @@ COMMANDS = [ # ======== 提醒功能 ======== Command( name="reminder", - pattern=re.compile(r"^(提醒\s*.+)$", re.IGNORECASE | re.DOTALL), # 匹配"提醒"开头(可无空格),捕获包括"提醒"在内的完整内容 + pattern=re.compile(r"提醒我", re.IGNORECASE), scope="both", # 支持群聊和私聊 need_at=True, # 在群聊中需要@机器人 priority=35, # 优先级适中,在基础命令后,复杂功能或闲聊前 handler=handle_reminder, - description="设置一个提醒 (例如:提醒 明天下午3点 开会 或 提醒我早上七点起床)" + description="设置一个提醒 (包含 '提醒我' 关键字即可, 例如:提醒我明天下午3点开会)" ), Command( diff --git a/function/func_duel.py b/function/func_duel.py index daa279e..a8357a2 100644 --- a/function/func_duel.py +++ b/function/func_duel.py @@ -1165,7 +1165,7 @@ def change_player_name(old_name: str, new_name: str, group_id=None) -> str: result = rank_system.change_player_name(old_name, new_name) if result: - return f"✅ 已成功将本群中的玩家 \"{old_name}\" 改名为 \"{new_name}\"" + return f"✅ 已成功将决斗记录中的玩家 \"{old_name}\" 重命名为 \"{new_name}\"" else: return f"❌ 改名失败:请确认 \"{old_name}\" 在本群中有战绩记录,且 \"{new_name}\" 名称未被使用" except Exception as e: