mirror of
https://github.com/Zippland/Bubbles.git
synced 2026-01-19 01:21:15 +08:00
优化提醒命令的处理逻辑,修改匹配模式为“提醒我”,并更新示例提示信息。同时,调整玩家改名反馈信息,明确指出是重命名决斗记录中的玩家。
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user