Skip to content

Prevent new broadcasts if an existing one is still in progress #9

@rainrisa

Description

@rainrisa

Currently, the bot allows users to initiate a new broadcast even if a previous one is still in progress. This can lead to multiple broadcasts running at the same time, which may cause the bot to exceed Telegram's rate limits (e.g., 30 messages per second).

// https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
let broadcastPerSecond = 30;

This results in:

  • Failed or delayed message delivery
  • Possible temporary blocks or restrictions from Telegram

To prevent this, the bot should:

  • Detect if a broadcast is already in progress
  • Block any new broadcast attempts during that time
  • Send a warning message to the user, such as:
    "Cannot start a new broadcast because another one is still running. Please wait for it to finish."

This will ensure stable operation and compliance with Telegram's messaging rate limits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions