High-Performance Telegram Broadcast Manager for MadelineProto. Manage broadcasts efficiently: send messages, media albums, pin/unpin messages, control broadcasts in real-time, and track live progress with advanced features.
-
π High-Performance Broadcasts Send messages concurrently to thousands of users, groups, or channels with configurable concurrency.
-
βΈ Pause / Resume / Cancel Broadcasts Control ongoing broadcasts in real-time without restarting.
-
π Pin & Unpin Messages
- Pin the last broadcasted message automatically.
- Unpin all messages for all subscribers.
-
π§Ή Delete Last Broadcast
- Remove previously sent messages from all users.
- Retries failed deletions and handles Telegram API limits automatically.
-
β»οΈ Delete All Broadcasts
- Remove previously all sent messages from all users.
- Retries failed deletions and handles Telegram API limits automatically.
-
π Live Progress Tracking
- Visual progress bars
- Messages per second (TPS)
- Sent, failed, and pending counts
- Paused/cancelled indicators
-
πΌ Media Albums Support
- Send multiple images/documents in a single broadcast using
sendMultiMedia. - Supports captions and message entities.
- Send multiple images/documents in a single broadcast using
-
πΎ Saving & Reusing Albums
Save albums to a JSON file for reuse in future broadcasts.
Use album-bot as an example to store album files locally. -
π‘ FLOOD_WAIT Handling & Retries Automatically respects Telegram rate limits and retries failed messages.
-
π Inline Buttons / Reply Markup
- Include interactive buttons for links, commands, or actions.
BroadcastManager/
βββ src/
β βββ BroadcastManager.php
βββ data/
β βββ .gitkeep
βββ composer.json
βββ README.md
βββ LICENSE
βββ CHANGELOG.md
composer require wizardloop/broadcastmanagerInclude autoload:
require 'vendor/autoload.php';use BroadcastTool\BroadcastManager;
$manager = new BroadcastManager($api);
$manager->broadcastWithProgress(
allUsers: $users,
messages: $messages,
chatId: $adminChatId,
filterType: 'users',
pin: true,
concurrency: 25
);$manager->pause();
$manager->resume();
$manager->cancel();Check state:
if ($manager->isPaused()) echo "Paused";
if ($manager->isCancelled()) echo "Cancelled";
if (!$manager->hasLastBroadcast()) echo "No last Broadcast do delete";
if (!$manager->hasAllBroadcast()) echo "No all Broadcast to delete";
print_r($manager->progress());Set data dir:
BroadcastManager::setDataDir(__DIR__ . '/data');default is: DIR . '/../data'
$manager->deleteLastBroadcastForAll(
allUsers: $users,
chatId: $adminChatId,
concurrency: 20
);$manager->deleteAllBroadcastsForAll(
allUsers: $users,
chatId: $adminChatId,
concurrency: 20
);$manager->lastBroadcastData();Pin last broadcast automatically:
$manager->broadcastWithProgress(..., pin: true);Unpin all messages:
$manager->unpinAllMessagesForAll(...);$message = [
'message' => "Click a button below:",
'buttons' => [
[['text' => "Visit Website", 'url' => "https://example.com"]],
[['text' => "Start", 'callback_data' => "start_action"]]
]
];- Concurrency β Number of parallel workers.
- Filter Types β 'users', 'groups', 'channels', 'all'
- Album Handling β JSON-based albums with multiple media files.
- Retries & Delays β Automatic retries with backoff.
- Progress Tracking β Real-time broadcast stats with
progress().
- Fork repo
- Create branch:
git checkout -b feature/my-feature - Commit changes:
git commit -m "Add feature" - Push branch:
git push origin feature/my-feature - Open Pull Request
GNU AGPL-3.0 β see LICENSE.
See [CHANGELOG.md] for updates.
β Pro Tips
- Use
pin: trueto pin important broadcasts. - Include
buttonsfor interactive messages. - Adjust
concurrencyfor optimal performance. - Use
pause/resume/cancelfor safe broadcast control.