PHPackages                             wizardloop/broadcastmanager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wizardloop/broadcastmanager

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wizardloop/broadcastmanager
===========================

High-performance Telegram broadcast manager for MadelineProto

3.0.5(4mo ago)1130AGPL-3.0-onlyPHPPHP ^8.2

Since Jan 6Pushed 4mo agoCompare

[ Source](https://github.com/WizardLoop/BroadcastManager)[ Packagist](https://packagist.org/packages/wizardloop/broadcastmanager)[ Docs](https://github.com/WizardLoop/BroadcastManager)[ Fund](https://wizardloop.t.me/)[ GitHub Sponsors](https://github.com/WizardLoop)[ RSS](/packages/wizardloop-broadcastmanager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (0)

BroadcastManager
================

[](#broadcastmanager)

**High-Performance Telegram Broadcast Manager** for [MadelineProto](https://docs.madelineproto.xyz/). Manage broadcasts efficiently: send messages, media albums, pin/unpin messages, control broadcasts in real-time, and track live progress with advanced features.

[![AGPL License](https://camo.githubusercontent.com/0fb4f7634808706feb5d9bf669e078e2da524534575a39f2f08c74de3d8a1135/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4147504c2d2d332e302d626c75652e737667)](LICENSE)[![Made with ❤️](https://camo.githubusercontent.com/7af47cb8af6215f4f25fc29ad161d74fbc5040e73ac4d729bbf9d5b72fc1f715/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d616465253230776974682d2545322539442541342545462542382538462d626c7565)](https://github.com/WizardLoop/BroadcastManager)[![Packagist Version](https://camo.githubusercontent.com/1d035b762c86ddda0e6f69a27c2d13de416b035999006a724f34b4ccfd1fa027/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77697a6172646c6f6f702f62726f6164636173746d616e61676572)](https://packagist.org/packages/wizardloop/broadcastmanager)[![Packagist Downloads](https://camo.githubusercontent.com/65506add941efecd8fc010fa81be75759c839c6acbd588c818a872bb4090585e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77697a6172646c6f6f702f62726f6164636173746d616e616765723f636f6c6f723d626c7565)](https://packagist.org/packages/wizardloop/broadcastmanager)

---

🌟 Features
----------

[](#-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 &amp; 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.
- 💾 **Saving &amp; Reusing Albums**
    Save albums to a JSON file for reuse in future broadcasts.
    Use [album-bot](https://github.com/WizardLoop/album-bot/blob/main/poll-bot.php) as an example to store album files locally.
- 🛡 **FLOOD\_WAIT Handling &amp; Retries**Automatically respects Telegram rate limits and retries failed messages.
- 🔘 **Inline Buttons / Reply Markup**

    - Include interactive buttons for links, commands, or actions.

---

📁 Repository Structure
----------------------

[](#-repository-structure)

```
BroadcastManager/
├── src/
│   └── BroadcastManager.php
├── data/
│   └── .gitkeep
├── composer.json
├── README.md
├── LICENSE
└── CHANGELOG.md

```

---

💻 Requirements
--------------

[](#-requirements)

- [MadelineProto](https://docs.madelineproto.xyz/)
- [amphp/amp](https://amphp.org/)

---

⚡ Installation
--------------

[](#-installation)

```
composer require wizardloop/broadcastmanager
```

Include autoload:

```
require 'vendor/autoload.php';
```

---

🚀 Usage Example
---------------

[](#-usage-example)

```
use BroadcastTool\BroadcastManager;

$manager = new BroadcastManager($api);

$manager->broadcastWithProgress($users, $messages, $adminChatId, true, 20);
```

---

Filer Peers
-----------

[](#filer-peers)

```
$filterSub = $manager->filterPeers($users, 'users');
$targets = $filterSub['targets']; # array
$failed = $filterSub['failed']; # int
$total = $filterSub['total']; # int
```

---

⏸ Control Broadcasts
--------------------

[](#-control-broadcasts)

```
$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'*

---

🧹 Delete Last Broadcast
-----------------------

[](#-delete-last-broadcast)

```
$manager->deleteLastBroadcastForAll($users, $adminChatId, 20);
```

---

♻️ Delete All Broadcast
-----------------------

[](#️-delete-all-broadcast)

```
$manager->deleteAllBroadcastsForAll($users, $adminChatId, 20);
```

---

📊 Get Last Broadcast Data
-------------------------

[](#-get-last-broadcast-data)

```
$manager->lastBroadcastData();
```

---

📌 Pin / Unpin Messages
----------------------

[](#-pin--unpin-messages)

Pin last broadcast automatically:

```
$manager->broadcastWithProgress(..., pin: true);
```

Unpin all messages:

```
$manager->unpinAllMessagesForAll(...);
```

---

🔘 Inline Buttons &amp; Reply Markup
-----------------------------------

[](#-inline-buttons--reply-markup)

```
$message = [
    'message' => "Click a button below:",
    'buttons' => [
        [['text' => "Visit Website", 'url' => "https://example.com"]],
        [['text' => "Start", 'callback_data' => "start_action"]]
    ]
];
```

---

⚙️ Advanced Options
-------------------

[](#️-advanced-options)

- **Concurrency** – Number of parallel workers.
- **Filter Types** – 'users', 'groups', 'channels', 'all'
- **Album Handling** – JSON-based albums with multiple media files.
- **Retries &amp; Delays** – Automatic retries with backoff.
- **Progress Tracking** – Real-time broadcast stats with `progress()`.

---

🤝 Contributing
--------------

[](#-contributing)

1. Fork repo
2. Create branch: `git checkout -b feature/my-feature`
3. Commit changes: `git commit -m "Add feature"`
4. Push branch: `git push origin feature/my-feature`
5. Open Pull Request

---

📄 License
---------

[](#-license)

**GNU AGPL-3.0** — see [LICENSE](LICENSE).

---

📝 Changelog
-----------

[](#-changelog)

See \[CHANGELOG.md\] for updates.

---

✅ **Pro Tips**

- Use `pin: true` to pin important broadcasts.
- Include `buttons` for interactive messages.
- Adjust `concurrency` for optimal performance.
- Use `pause/resume/cancel` for safe broadcast control.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance78

Regular maintenance activity

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

17

Last Release

121d ago

Major Versions

1.0.4 → 2.0.02026-01-07

2.0.5 → 3.0.02026-01-11

PHP version history (2 changes)1.0.0PHP &gt;=8.2

2.0.5PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6856538a4d6f912393bf308109dce694ae346a294e7a0def085c4c9b1f1b2fff?d=identicon)[WizardLoop](/maintainers/WizardLoop)

---

Top Contributors

[![WizardLoop](https://avatars.githubusercontent.com/u/67387949?v=4)](https://github.com/WizardLoop "WizardLoop (88 commits)")

---

Tags

broadcastmadelineprotomtprotophptelegramphpbottelegramBroadcastmadelineproto

### Embed Badge

![Health badge](/badges/wizardloop-broadcastmanager/health.svg)

```
[![Health](https://phpackages.com/badges/wizardloop-broadcastmanager/health.svg)](https://phpackages.com/packages/wizardloop-broadcastmanager)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
