Skip to content

[Feature]: Telegram cron delivery should optionally create a fresh DM topic per execution #50668

Description

@pan-long

Problem or Use Case

When Telegram DM topic mode is enabled, cron jobs using deliver: "origin" post back to the same topic where the job was created. If the user creates a job from Topic A but later works in Topic B, cron output lands in Topic A - appearing in a random topic.

Each cron delivery should create a new Telegram DM topic that specific execution, so output is always scoped and discoverable.

Telegram equivalent of #16567 (Discord: fresh thread per cron execution).

Proposed Solution

Add an optional per-job delivery mode for Telegram cron jobs that calls createForumTopic (Bot API 9.4+) before delivering:

deliver: telegram
telegram_topic_mode: new_per_run
topic_name_template: "Cron: {job_name} - {date}"
  • new_per_run: create a forum topic, get message_thread_id, post there
  • fixed (default, current): deliver to configured home topic or origin

Backward-compatible - existing jobs continue as-is.

Alternatives Considered

  1. Dedicated topic via TELEGRAM_CRON_THREAD_ID - mixes all output into one topic
  2. Deliver to lobby/General topic - blocked by lobby reminder ([Bug]: Replying to telegram topic main chat, not allowed. #24409)
  3. Manual topic creation - defeats automation purpose

Related Issues

Feature Type

Gateway / messaging improvement

Scope

Medium (cron delivery + Telegram adapter topic creation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cronCron scheduler and job managementcomp/gatewayGateway runner, session dispatch, deliveryplatform/telegramTelegram bot adaptertype/featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions