Skip to content

Broadcast (/broadcast)

Broadcast (/broadcast)

The /broadcast command lets an admin send a single message (text or media, formatting preserved) to all active users via Telegram copyMessage — the message is copied without the “Forwarded from” label.

Access

  • admin — via assigned role (role_grants)
  • super_admin — via TELEGRAM_SUPER_ADMIN_ID

Other roles get “У вас нет доступа к этой команде.” (no access).

Supported message types

TypeExample
Textplain message with formatting (bold, italic, links)
Photowith or without caption
Videowith or without caption
AnimationGIF
Documentfile
Audiomusic file
Voicevoice message
Video noteround video message

Flow

  1. Send /broadcast.
  2. The bot replies: “Отправьте сообщение для рассылки…” (send a message to broadcast).
  3. Send a message of any supported type.
  4. The bot resolves the number of active recipients N:
    • no active users → “Нет активных пользователей”, the broadcast is aborted;
    • otherwise → “Рассылка будет отправлена N получателям. Отправить?” with ✅ Отправить / ❌ Отмена buttons.
  5. Press ✅ Отправить — the broadcast starts (⏳ Отправляем...).
  6. When done, the bot reports: “Отправлено X · Не доставлено Y” (Sent X · Not delivered Y).

Recipients

The broadcast goes to users with active status (residents, guards and admins included). Users with blocked status (including those who blocked the bot — platform block) are not included. If a user blocks the bot after the list is built, Telegram returns 403 — that recipient counts as “not delivered”.

Limitations

  • Concurrency is capped at 5 parallel sends.
  • On 429 (Too Many Requests) the bot waits retry_after seconds and retries once; a repeated failure marks the recipient as not delivered.
  • For very large recipient lists the broadcast may take considerable time.
  • Message content is not persisted — only message_id and metadata are stored in the audit.

Audit

After the broadcast finishes, an broadcast.sent event is written to audit_events with metadata:

{ total, sent, failed, messageId, mediaType }

targetId is null (the broadcast is not tied to a single user). This keeps admin actions traceable (152-FZ).