PHPackages                             shklyaev-p-a/telegram-bot-wrapper - 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. shklyaev-p-a/telegram-bot-wrapper

ActiveLibrary[API Development](/categories/api)

shklyaev-p-a/telegram-bot-wrapper
=================================

simple wrapper for telegram-bot/api library

015PHP

Since Dec 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shklyaev-p-a/telegram-bot-wrapper)[ Packagist](https://packagist.org/packages/shklyaev-p-a/telegram-bot-wrapper)[ RSS](/packages/shklyaev-p-a-telegram-bot-wrapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

**Init**
--------

[](#init)

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

(new \BotWrapper\Factories\BotFactory())->token('your token')
    ->bindData([name => val]) //forward data to properties
    ->middlewares([])
    ->commands([
        BotWrapper\Examples\HelloCommand::class,
        \BotWrapper\Examples\GoodbyeCommand::class
    ])
    ->messages([
        \BotWrapper\Examples\TestMessage::class
    ])
    ->queries([])
    ->actions([])
    ->create();

```

bot has only one version itself. You can access to bot by way: `$bot = Bot::getInstance();`

middlewares, messages, queries and other classes must be created from abstract parents from `BotWrapper\Chaining` folder

**Description**
---------------

[](#description)

This library just a simple wrapper on other library for more faster, readable and growing projects. This library implements next patterns: singleton (for only one bot class in application), chaining with middleware (for consistently bot queries binding), strategy (for choose one of three class match signature type: array, string or regexp), and simple factories with classes builder for bot and matcher classes.

You can find example in src\\Examples;

full info about using library you can find in:

#### **Middlewares classes**

[](#middlewares-classes)

classes for setting lastAction (default = empty string) in bot property or other metadata who can be needed in bot lifecycle

#### **Commands classes**

[](#commands-classes)

comands classes is using for detect telegram command like /start or other who starting from '\\' symbol

#### **Messages classes**

[](#messages-classes)

messages classes is using for detect telegram reply keyboard message who sending to chat like simple text after pushing at menu button

#### **Actions classes**

[](#actions-classes)

action classes need be using with custom middleware class who binding in bot property lastAction id from your system as signature it need for simple text what users sending in chat. To determine what we need to do based on the last action

For simple user input text processing you need is using messages classes

For a bot, there is no difference between reply keyboard button text and users input text.

#### **Queries classes**

[](#queries-classes)

action classes determine inline keyboard button data

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4de5a253d851cecfb2bf0577dfecdf03cffe60fc187d95c4efc975fcf2f36e2a?d=identicon)[shklyaev.p.a](/maintainers/shklyaev.p.a)

---

Top Contributors

[![GMittchel](https://avatars.githubusercontent.com/u/25344654?v=4)](https://github.com/GMittchel "GMittchel (23 commits)")

### Embed Badge

![Health badge](/badges/shklyaev-p-a-telegram-bot-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/shklyaev-p-a-telegram-bot-wrapper/health.svg)](https://phpackages.com/packages/shklyaev-p-a-telegram-bot-wrapper)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

1.6k92.9M270](/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.1M452](/packages/google-gax)

PHPackages © 2026

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