PHPackages                             hosseinhunta/php-telegram-api-bot - 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. [API Development](/categories/api)
4. /
5. hosseinhunta/php-telegram-api-bot

ActiveLibrary[API Development](/categories/api)

hosseinhunta/php-telegram-api-bot
=================================

A PHP SDK for Telegram Bot API with full method support and robust error handling

0.1.2(1y ago)17MITPHPPHP ^8.2

Since Apr 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hosseinhunta/php-telegram-api-bot)[ Packagist](https://packagist.org/packages/hosseinhunta/php-telegram-api-bot)[ RSS](/packages/hosseinhunta-php-telegram-api-bot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

 [![Telegram Bot API - PHP SDK Banner](/docs/static/img/logo.png)](/docs/static/img/logo.png)

 [![Total Downloads](https://camo.githubusercontent.com/760264f42ca5c7ce8870497c9925e959abaa1e075dbf1ab5ce7666c0deb67a9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686f737365696e68756e74612f7068702d74656c656772616d2d6170692d626f742e737667)](https://packagist.org/packages/irazasyed/telegram-bot-sdk) [![Latest Stable Version](https://camo.githubusercontent.com/e990faf19a4fea185a010cc07d3175f946bf1074ed90b82aebf56ad4b30f44b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686f737365696e68756e74612f7068702d74656c656772616d2d6170692d626f742e737667)](https://packagist.org/packages/irazasyed/telegram-bot-sdk) [![Telegram Group](https://camo.githubusercontent.com/67088ad6baacad6b4cbc3bbc24d00ad0f495ac06256f74c1da8ac8be5cee2f43/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54656c656772616d2d4a6f696e25323047726f75702d626c7565)](https://t.me/php_telegram_api_bot) [![GitHub Stars](https://camo.githubusercontent.com/da1fa6cf42cf83a70b838a88219719ad960af39bd4856ce6c4aaef94f8cf59ca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f686f737365696e68756e74612f7068702d74656c656772616d2d6170692d626f743f7374796c653d736f6369616c)](https://github.com/hosseinhunta/php-telegram-api-bot) [![License](https://camo.githubusercontent.com/aca1d0bfeb5f0c6f07b0559f611b58d31eeac8ff75b5ace64842047763dc61e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f686f737365696e68756e74612f7068702d74656c656772616d2d6170692d626f74)](https://github.com/hosseinhunta/php-telegram-api-bot/blob/main/LICENSE) [![Open Source](https://camo.githubusercontent.com/be0329c07c65d567c874f00316fc1716017dd065e6dd16b9c20be29760d58d93/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f70656e253230536f757263652d5965732d627269676874677265656e)](https://github.com/hosseinhunta/php-telegram-api-bot) [![Contributors](https://camo.githubusercontent.com/41c79535f9e8eca86b053ef8511adfb608cb4854e7b6d7b962672d7bc5728601/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f686f737365696e68756e74612f7068702d74656c656772616d2d6170692d626f74)](https://github.com/hosseinhunta/php-telegram-api-bot/graphs/contributors)

Telegram Bot API - PHP SDK (Beta)
---------------------------------

[](#telegram-bot-api---php-sdk-beta)

This is a PHP SDK for the Telegram Bot API, designed to make building Telegram bots as easy and fun as possible! Whether you're a beginner or an experienced developer, this library is built with simplicity, security, and performance in mind. It comes packed with features, tons of examples, and—most importantly—a detailed documentation site that shows you just how simple it is to create Telegram bots with PHP.

We’ve worked hard to make this library a go-to tool for anyone looking to create Telegram bots without the hassle. It’s lightweight, secure, and optimized for real-world use cases, so you can focus on building your bot instead of wrestling with complicated code.

---

### Supported Telegram Bot API Methods

[](#supported-telegram-bot-api-methods)

This SDK currently supports **all** Telegram Bot API methods! Here’s a quick overview:

MethodSupported`sendMessage`✅`getMe`✅`sendPhoto`✅`sendAudio`✅`sendDocument`✅`sendVideo`✅`sendAnimation`✅`sendVoice`✅`sendVideoNote`✅`sendMediaGroup`✅`getUpdates`✅`setWebhook`✅`deleteWebhook`✅`getChat`✅`getChatMember`✅`answerCallbackQuery`✅...and more!✅Yes, you read that right—**every method** in the Telegram Bot API is supported in this SDK! 🎉

---

### Documentation

[](#documentation)

Want to dive deeper? Check out our detailed documentation, available in two languages:

- [English Documentation](https://hosseinhunta.github.io/php-telegram-api-bot/en)
- [Persian Documentation (مستندات فارسی)](https://hosseinhunta.github.io/php-telegram-api-bot/fa)

The docs will guide you through everything—from installation to advanced usage—with plenty of examples to get you started.

---

### TODO: Upcoming Features

[](#todo-upcoming-features)

We’re working hard to make this SDK even better! Here’s what’s on the horizon:

- Build a command and event handler for better bot management.
- Optimize the update handler for smoother performance.
- Enhance code security and stability.
- Complete and polish the documentation.
- Update the SDK to support Telegram Bot API version 8.3.
- Add support for complex data types.
- Introduce middleware for advanced request handling.
- Improve webhook management with advanced features.
- Add advanced debugging tools (e.g., direct request/response dumping).
- Implement extensive unit tests and integration tests to ensure stability.
- Add plugin support for extending functionality.
- Further optimize performance for large-scale bots.
- Add support for inline query caching to reduce API calls.
- Create a built-in rate limiter to handle Telegram API limits.
- Add support for multi-bot management in a single instance.

Stay tuned for these updates as we continue to improve the SDK! 🚀

---

### Repository Creator's Note

[](#repository-creators-note)

Hey there! Yep, it’s me again—another Telegram bot library. But you might be wondering: why create yet another one? What’s wrong with the existing libraries? And what makes this one different?

These days, I’m going through a pretty strange phase in my life—a time when I don’t have much free time to dive into my true passion: coding. I really wanted to kick off my first GitHub repository with something meaningful, something that reflects the very first library I ever wrote. After coming back from some personal challenges (and a 12-day break), I thought, “How can I enjoy coding again while solving one of my problems?” During that time, I listened to a lot of music, and I got this idea to create a Telegram channel that could act like a playlist for me. I wanted a bot that could upload music links or files I send it as files in the channel, so I could always listen to them and share them with others. Plus, I wanted it to create a playlist for my favorite music platform.

When I started working on this with my old library, I realized how much room for improvement there was. So, I put the bot idea on hold and focused on building a better library instead. My goal? To create a comprehensive and complete library—at least a beta version—that can stand toe-to-toe with other similar libraries out there! When I say “comprehensive,” I mean it should have super clear, simple, and easy-to-understand documentation. So, I set my priorities: simplicity, security, tons of features, optimization, lots of examples, and—most importantly—a documentation site that shows everyone just how easy it is to build a Telegram bot with PHP.

Now, you might ask: why PHP? Why not Python, JavaScript, or even Dart—a language I’ve been working with a lot lately and absolutely love? Well, the first language I ever learned (at a very basic level) was PHP. Then I moved on to Python, and since the first library I ever wrote was in Python, I wanted to go back to those early days when I first fell in love with programming. So, I decided to build this with PHP. Plus, it’s a great chance to level up my PHP skills! Honestly, PHP 8.4 has made the language so much more exciting, and I’m done throwing shade at it.

As I’m writing this, I’ve got 3 days left of my break. My plan is to release a beta version in these 3 days and finally build that music bot I’ve been dreaming about. I hope this library keeps moving forward! :)

---

### Awesome Telegram Bots Built with Telegram Bot SDK!

[](#awesome-telegram-bots-built-with-telegram-bot-sdk)

Have you built a cool Telegram bot using this SDK? Let us know, and we’ll feature it here! Stay tuned for a growing list of awesome bots created by the community.

---

### Additional Information

[](#additional-information)

Any issues, feedback, suggestions, or questions? Please use the [issue tracker here](https://github.com/hosseinhunta/php-telegram-api-bot/issues).

---

### Contributing

[](#contributing)

Thank you for considering contributing to the project! Please review the [CONTRIBUTING guidelines](https://github.com/hosseinhunta/php-telegram-api-bot/blob/main/CONTRIBUTING.md) before submitting any pull requests.

---

### Credits

[](#credits)

This project was created by [HossienHunTa](https://github.com/hosseinhunta).

---

### Disclaimer

[](#disclaimer)

This SDK is currently in beta, and while we’ve done our best to ensure it works smoothly, there might be bugs or unexpected behavior. Use it at your own risk, and feel free to report any issues you encounter.

---

### License

[](#license)

This project is licensed under the [MIT License](https://github.com/hosseinhunta/php-telegram-api-bot/blob/main/LICENSE)—feel free to use, modify, and distribute it as you like!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance46

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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 ~2 days

Total

2

Last Release

402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29147907209f884305c6fd3cddf67324d1024956b7cc6a8e5a75d51ecdf5c376?d=identicon)[hosseinhunta](/maintainers/hosseinhunta)

---

Top Contributors

[![hosseinhunta](https://avatars.githubusercontent.com/u/185372063?v=4)](https://github.com/hosseinhunta "hosseinhunta (32 commits)")

### Embed Badge

![Health badge](/badges/hosseinhunta-php-telegram-api-bot/health.svg)

```
[![Health](https://phpackages.com/badges/hosseinhunta-php-telegram-api-bot/health.svg)](https://phpackages.com/packages/hosseinhunta-php-telegram-api-bot)
```

###  Alternatives

[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1326.2k](/packages/zepgram-module-rest)

PHPackages © 2026

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