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— viaTELEGRAM_SUPER_ADMIN_ID
Other roles get “У вас нет доступа к этой команде.” (no access).
Supported message types
| Type | Example |
|---|---|
| Text | plain message with formatting (bold, italic, links) |
| Photo | with or without caption |
| Video | with or without caption |
| Animation | GIF |
| Document | file |
| Audio | music file |
| Voice | voice message |
| Video note | round video message |
Flow
- Send
/broadcast. - The bot replies: “Отправьте сообщение для рассылки…” (send a message to broadcast).
- Send a message of any supported type.
- The bot resolves the number of active recipients
N:- no active users → “Нет активных пользователей”, the broadcast is aborted;
- otherwise → “Рассылка будет отправлена N получателям. Отправить?” with
✅ Отправить/❌ Отменаbuttons.
- Press
✅ Отправить— the broadcast starts (⏳ Отправляем...). - 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 waitsretry_afterseconds 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_idand 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).