PHPackages                             muaath5/simple-bot-api - 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. muaath5/simple-bot-api

ActiveLibrary[API Development](/categories/api)

muaath5/simple-bot-api
======================

Simple &amp; Easy Telegram Bot API in PHP

v5.4(4y ago)76631GPL-3.0-onlyPHP

Since Oct 8Pushed 1y ago3 watchersCompare

[ Source](https://github.com/Muaath5/SimpleBotAPI)[ Packagist](https://packagist.org/packages/muaath5/simple-bot-api)[ RSS](/packages/muaath5-simple-bot-api/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

Simple Bot API
==============

[](#simple-bot-api)

[![Licence: GPL v3.0](https://camo.githubusercontent.com/1bf7d680781063682329bd2009b9109fcf413d0768593a3e58b8f8da8426962c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d47504c25323076332e302d677265656e)](LICENCE)[![Bot API Version: 5.6](https://camo.githubusercontent.com/9528108898524b2386baeb9052ad5717617d98eb7a76f0065d66ae83fd8ec985/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f426f7425323041504925323056657273696f6e2d352e362d646f64676572626c7565)](https://core.telegram.org/bots/api)[![PHP Unit Tests](https://github.com/Muaath5/SimpleBotAPI/actions/workflows/php.yml/badge.svg)](https://github.com/Muaath5/SimpleBotAPI/actions/workflows/php.yml)

This is a simple Telegram Bot API library in PHP. This library should support all Bot API methods in any version update. I created this library to make creating bots more simpliler, No need to bunch of classes And objects after today!

Features
--------

[](#features)

- Always supports all Bot API methods
- Auto handling for flood &amp; chat ID migrating errors
- Uses `stdClass` for updates
- Uses OOP
- Optional Settings for each bot can be saved in JSON
- Based on cURL for speed
- Downloadable via composer
- Tested via GitHub Actions
- Has examples of working bots
- Telegram Errors as PHP Exceptions
- Up to date
- Documented

Installation
------------

[](#installation)

[Installation Guide](https://muaath5.github.io/SimpleBotAPI/Installation)

Simple Usage
------------

[](#simple-usage)

### Creating bot

[](#creating-bot)

```
use SimpleBotAPI/TelegramBot;
use SimpleBotAPI/BotSettings;

$Bot = new TelegramBot('bot_token');
```

More documentation [here](https://muaath5.github.io/SimpleBotAPI/CreatingBot)

### Using method

[](#using-method)

It should be in this format:

```
$Result = $Bot->{methodName}([
    '{paramName}' => {value1},
    '{paramName2}' => {value2}
]);

```

Like this:

```
$Bot->SendMessage([
    'chat_id' => '@MuaathBots',
    'text' => 'This post was sent by the bot..'
]);

$my_channel_info = $Bot->getChat([
    'chat_id' => '@MuaathBots',
]);
echo "Your channel (@{$my_channel_info->username}) ID: {$my_channel_info->id}";
```

**Note:** There's NO PROBLEM if `methodName` was in upper or lower case.

Contibuting
-----------

[](#contibuting)

You can contribute by:

- Reporting a bug.
- Suggesting a feature.
- Improving code style.
- Completing the TODO List.
- Adding more examples to `examples/`.
- Documenting undocumented topics in `docs/`.
- Updating the library to the next version of Bot API (if needed).
- Adding more tests in `test/` folder.

Contact me
----------

[](#contact-me)

[![@Muaath_5 on Telegram](https://camo.githubusercontent.com/c734205eccca85f5db2bb434d8207f21c71ec70d55ec4394de9ed5d9435c82d8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54656c656772616d2d404d75616174685f352d626c7565)](https://t.me/Muaath_5)[![muaath1428@hotmail.com](https://camo.githubusercontent.com/527a039d537bb33ca9e0b90caf0109c189b26882be73df4e2831159bad50c88e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456d61696c2d6d75616174683134323840686f746d61696c2e636f6d2d6f72616e6765)](mailto:muaath1428@hotmail.com)

Examples
--------

[](#examples)

Currently, There're three examples in `examples/` folder:

- Echo Bot, Which sends same as you sent
- Weclome Bot, Which sends Welcome &amp; ID of user who joins the group
- Contact Me Bot, Which is a Bot be same as you, You'll receive messages &amp; Reply
- FAQ Bot, Which has one message &amp; buttons to swap between questions, And you can see answers.

You can see a full example [here](https://muaath5.github.io/SimpleBotAPI/FullExample)

**All of these examples doesn't need any databases or files to storage, Only Settings file.**

TODO List
---------

[](#todo-list)

- API via HTTP response in webhooks method
- Using namespace for exceptions
- Documenting sending message with reply markup
- Add webhook authorization
- Auto-store for bot users
- Add JSON Storage can be used by bot
- Method that posts to all bot users
- Add logging
- Add DB Storage can be used by bot
- Document missed things

License
-------

[](#license)

[![Licence: GPL v3.0](https://camo.githubusercontent.com/1bf7d680781063682329bd2009b9109fcf413d0768593a3e58b8f8da8426962c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d47504c25323076332e302d677265656e)](LICENCE)GPL-3.0, In LICENCE file.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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

Total

6

Last Release

1616d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de4882766dca99e112c183d1ea168507c756582a44ff5a6a60ff799b2cda4525?d=identicon)[Muaath\_5](/maintainers/Muaath_5)

---

Top Contributors

[![Muaath5](https://avatars.githubusercontent.com/u/60256639?v=4)](https://github.com/Muaath5 "Muaath5 (87 commits)")

---

Tags

botbot-apiphpphp8telegramtelegram-apitelegram-bottelegram-bot-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/muaath5-simple-bot-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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