Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Last verified:
What is Telegram Bot Sdk?
Telegram Bot SDK is a PHP library that lets developers create Telegram bots easily. It is an unofficial SDK for PHP that provides a simple interface to Telegram's Bot HTTP API, wrapping all API methods into easy-to-use PHP functions. The toolkit is packed with features needed to create dynamic and engaging bots, including multi-bot support, command handlers, and events & plugins support.
Key features include effortless management of multiple bots through the BotsManager, an easy command handler for crafting bot commands, events and plugins support to extend bot functionality, full Laravel framework integration with built-in support and facades, and access to all available Telegram Bot API methods. The SDK automatically maps Telegram Bot API responses to PHP objects with helpful methods for accessing data.
This SDK is designed for PHP developers and Laravel enthusiasts who want to build Telegram bots without dealing with raw HTTP requests. It is recommended by Telegram and has been in development since 2015 with over 1.8 million installs and 2.6K stargazers on GitHub. The project is open-source under the BSD 3-Clause license.
Telegram Bot Sdk pricing
Pricing model: Freemium
Free and open-source under the BSD 3-Clause license. No paid plans or tiers - the SDK is completely free to use. Available via Packagist (composer require telegram-bot-sdk/telegram-bot-sdk) with 1.8M+ installs. No subscription, no premium features, no usage limits imposed by the SDK itself.
Telegram Bot Sdk pros
- Officially recommended by Telegram
- Built-in Laravel framework support with facades
- Multi-bot support via BotsManager
- Easy command handler for bot commands
- Events and plugins support for extensibility
- Over 1.8 million installs
- 2.6K+ stargazers on GitHub
- Since 2015 with active maintenance
- All Telegram Bot API methods available
- Responses automatically mapped to PHP objects
- Uses Laravel Collection API for data handling
- Open-source BSD 3-Clause license
- Standalone and Laravel initialization options
- Environment variable support for bot token
- Service container dependency injection support
Telegram Bot Sdk cons
- Unofficial third-party library not affiliated with Telegram
- PHP only - no support for other languages
- Requires PHP 7.2 or higher
- Depends on Guzzle HTTP library
- May have lag behind official API updates
- Laravel features moved to separate package in 4.x
- Requires renaming in composer.json when upgrading from <4.x
- Some issues open on GitHub repository
Frequently asked questions about Telegram Bot Sdk
What is Telegram Bot SDK?
Telegram Bot SDK is an unofficial PHP SDK that lets you develop Telegram bots easily. It wraps Telegram's HTTP Bot API into easy-to-use PHP functions and supports the Laravel framework out of the box.
How do I initialize the SDK?
You need to configure the SDK with your Bot Token from BotFather. In standalone mode: use new Api('YOUR BOT TOKEN'). In Laravel, initialization is handled automatically by the service provider - just use the Telegram facade.
Can I manage multiple bots?
Yes, the SDK supports multi-bot management through the BotsManager class. You configure multiple bots in an array with their tokens, then access them using $telegram->bot('mybot')->getMe().
Does it work with Laravel?
Yes, Telegram Bot SDK has built-in Laravel support with facades and service container integration. In Laravel 4.x, the service provider is in a separate package (telegram-bot-sdk/laravel ^4.0).
What is the latest version?
The latest version is 3.10. Version 4.x was renamed from irazasyed/telegram-bot-sdk to telegram-bot-sdk/telegram-bot-sdk and moved Laravel features to a separate package.
Is this officially from Telegram?
No, this is a third-party library not associated with, endorsed by, or affiliated with Telegram or its products. However, it is recommended by Telegram and wraps the official Bot API.
What license is it under?
The SDK is open-source software licensed under the BSD 3-Clause license, making it free to use, modify, and distribute.
How do I handle API responses?
Responses are automatically mapped to PHP objects with helpful methods. For example, getMe() returns a User object where you can call getId(), getFirstName(), and getUsername() methods.
What are the system requirements?
The SDK requires PHP ^7.2 and depends on Guzzle HTTP libraries (guzzlehttp/guzzle ^6.1 and guzzlehttp/psr7 ^1.3). For Laravel support, it requires illuminate/support ^5.5 || ^6.0 || ^7.0.
How do I report security issues?
Security vulnerabilities should be emailed to security at telegram-bot-sdk.com. All security vulnerabilities will be promptly addressed by the team.