feat: per-chat command toggle, listener name + toggle in bot tab
- Add commands_enabled field to TelegramChat (default off) with migration, gating command dispatch in both poller and webhook - Show toggle switch per chat in bot tab for enabling/disabling commands - Fix listener response to include bot name instead of just type - Replace listener "Enabled" label + "Edit" link with toggle switch and crosslink to command-trackers page
This commit is contained in:
@@ -207,6 +207,13 @@ async def migrate_schema(engine: AsyncEngine) -> None:
|
||||
)
|
||||
logger.info("Added language_code column to telegram_chat table")
|
||||
|
||||
# Add commands_enabled to telegram_chat if missing (default disabled)
|
||||
if not await _has_column(conn, "telegram_chat", "commands_enabled"):
|
||||
await conn.execute(
|
||||
text("ALTER TABLE telegram_chat ADD COLUMN commands_enabled INTEGER DEFAULT 0")
|
||||
)
|
||||
logger.info("Added commands_enabled column to telegram_chat table")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Legacy tracker_target migration (pre-Phase 1)
|
||||
|
||||
Reference in New Issue
Block a user