fix(trigger): require names for trigger creation

This commit is contained in:
chengyongru
2026-07-02 13:32:46 +08:00
committed by Xubin Ren
parent 7178ea3f13
commit b690a48336
10 changed files with 60 additions and 19 deletions
+4 -4
View File
@@ -218,13 +218,13 @@ if DISCORD_AVAILABLE:
command_text = f"/model {preset}" if preset else "/model"
await self._forward_slash_command(interaction, command_text)
@self.tree.command(name="trigger", description="Create a local trigger for this chat")
@app_commands.describe(name="Optional trigger name")
@self.tree.command(name="trigger", description="Create a named local trigger for this chat")
@app_commands.describe(name="Trigger name")
async def trigger_command(
interaction: discord.Interaction,
name: str | None = None,
name: str,
) -> None:
name = (name or "").strip()
name = name.strip()
command_text = f"/trigger {name}" if name else "/trigger"
await self._forward_slash_command(interaction, command_text)
+1 -1
View File
@@ -411,7 +411,7 @@ class TelegramChannel(BaseChannel):
BotCommand("status", "Show bot status"),
BotCommand("history", "Show recent conversation messages"),
BotCommand("goal", "Start a sustained objective (long-running task)"),
BotCommand("trigger", "Create a local trigger for this chat"),
BotCommand("trigger", "Create a named local trigger"),
BotCommand("pairing", "Manage DM pairing (approve/deny/list)"),
BotCommand("model", "Switch runtime model preset"),
BotCommand("skill", "List enabled skills"),