Addon Manager for Telegram Bot SDK

dev-main / 1.0.x-dev 2023-04-06 01:46 UTC

This package is auto-updated.

Last update: 2023-11-06 03:00:19 UTC


Join PHP Chat Chat on Telegram Build Status Latest Version Total Downloads

Addon Manager to add, remove, manage and load addons into Telegram Bot SDK.

If you want to develop addons for Telegram Bot SDK, please make sure to require this package in your composer file.


$ composer require telegram-bot-sdk/addon-manager


Create An Addon


namespace Acme\Addons;

use Telegram\Bot\Addon\Addon;
use Telegram\Bot\Events\UpdateEvent;

class AcmeAddon extends Addon
    public function register()
        $this->bot->onUpdate(function (UpdateEvent $event) {
            $bot = $event->bot;
            $update = $event->update;

            // Do something with the inbound update received.

Register Addon


The Addon Manager supports auto-discovery which registers the addons automatically.

Simply create a discovery.json file in your project root.

  "telegram/addon-config": [
  "telegram/addon": [

Manually Register

use Acme\Addons\AcmeAddon;
use Telegram\Bot\Addon\AddonManager;

// Make sure to register before initializing bot manager.

Remove Addon


Get Addons

$addons = AddonManager::getAddons();

Auto-Discover & Register Addons


Are You Using Telegram Bot SDK?

If you're using Telegram Bot SDK build your Telegram Bots or have a project that's relevant to the SDK, We'd love to know and share it with the world.

Head over to Awesome Telegram Bots to share, discover, and learn more.


Thank you for considering contributing to the project. Please read the contributing guide before creating an issue or sending in a pull request.

Code of Conduct

Please read our Code of Conduct before contributing or engaging in discussions.


If you discover a security vulnerability within this project, please email Syed at syed at All security vulnerabilities will be promptly addressed. You may view our full security policy here.



This project is open-sourced software licensed under the BSD 3-Clause license.