PHPackages                             belka-tech/php-vk-teams-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. belka-tech/php-vk-teams-bot

ActiveLibrary[API Development](/categories/api)

belka-tech/php-vk-teams-bot
===========================

PHP client for VK Teams Bot API (aka ICQ Bot)

0.3.0(3mo ago)132MITPHPPHP ^8.2CI passing

Since Mar 20Pushed 3mo agoCompare

[ Source](https://github.com/belka-tech/php-vk-teams-bot)[ Packagist](https://packagist.org/packages/belka-tech/php-vk-teams-bot)[ RSS](/packages/belka-tech-php-vk-teams-bot/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (12)Versions (12)Used By (0)

PHP VK Teams Bot API (aka ICQ Bot)
==================================

[](#php-vk-teams-bot-api-aka-icq-bot)

[![Latest Version](https://camo.githubusercontent.com/56ca7a1ef8a0ce23b994bef3923f6b3436ab309aedb038acd9fbdaccad893259/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656c6b612d746563682f7068702d766b2d7465616d732d626f742e7376673f7374796c653d666c61742d737175617265266c6162656c3d6c617465737425323076657273696f6e)](https://packagist.org/packages/belka-tech/php-vk-teams-bot)[![Build](https://camo.githubusercontent.com/9af5b9885f5175a1c0845a9a6eeb0f2941d5d7d1108a4a01920d3c94e11e0a39/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62656c6b612d746563682f7068702d766b2d7465616d732d626f742f74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/belka-tech/php-vk-teams-bot/actions/workflows/tests.yml)[![License](https://camo.githubusercontent.com/ca1aec086009a463615963cf405d2b8b47ca1239ea1d2eaed05383bf151621b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f62656c6b612d746563682f7068702d766b2d7465616d732d626f742e7376673f7374796c653d666c61742d737175617265)](https://github.com/belka-tech/php-vk-teams-bot/blob/master/LICENSE)

Introduction
------------

[](#introduction)

PHP client for VK Teams Bot API. Provides a typed interface for sending messages, managing chats, and receiving events via long polling.

Official documentation:

Requirements
------------

[](#requirements)

- PHP 8.2+
- PSR-18 HTTP Client (`psr/http-client`)
- PSR-17 HTTP Factories (`psr/http-factory`)
- PSR-3 Logger (`psr/log`) — optional, for `LoggingHttpClient`

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

[](#installation)

```
composer require belka-tech/php-vk-teams-bot
```

Quick Start
-----------

[](#quick-start)

```
$bot = new \BelkaTech\VkTeamsBot\Bot(
    new \BelkaTech\VkTeamsBot\Http\HttpClient(
        baseUri: 'https://api.icq.net/bot',
        token: 'YOUR_BOT_TOKEN',
        client: new \GuzzleHttp\Client(
            [
                'connect_timeout' => 4,
                'timeout' => 15,
                'http_errors' => false,
            ],
        ),
        requestFactory: new \GuzzleHttp\Psr7\HttpFactory(),
        streamFactory: new \GuzzleHttp\Psr7\HttpFactory(),
    ),
);

// Send a text message
$bot->messages->sendText(
    chatId: 'YOUR_CHAT_ID',
    text: 'Hello!',
);
```

API
---

[](#api)

### Messages (`$bot->messages`)

[](#messages-bot-messages)

MethodDescription`sendText()`Send a text message`sendFile()`Send a file`sendVoice()`Send a voice message`editText()`Edit a message`deleteMessages()`Delete messages`answerCallbackQuery()`Answer a callback query`pinMessage()`Pin a message`unpinMessage()`Unpin a message`filesGetInfo()`Get file information### Chats (`$bot->chats`)

[](#chats-bot-chats)

MethodDescription`create()`Create a chat`addMembers()`Add members`removeMembers()`Remove members`sendAction()`Send an action (typing, etc.)`getInfo()`Get chat information`getAdmins()`List administrators`getMembers()`List members`blockUser()`Block a user`unblockUser()`Unblock a user`resolvePending()`Approve/reject join requests`setTitle()`Set chat title`setAvatar()`Set chat avatar`setAbout()`Set chat description`setRules()`Set chat rules### Events API (`$bot->events`)

[](#events-api-bot-events)

MethodDescription`get()`Fetch events (long polling)### Event Listener

[](#event-listener)

Long polling with event dispatching:

```
$botEventListener = new \BelkaTech\VkTeamsBot\BotEventListener(
    bot: $bot,
);

// Register event handlers
$botEventListener->onMessage(
    function (
        \BelkaTech\VkTeamsBot\Bot $bot,
        \BelkaTech\VkTeamsBot\Event\EventDto $event,
    ): void {
        $bot->messages->sendText(
            chatId: $event->payload['chat']['chatId'],
            text: 'Pong!',
        );
    },
);

$botEventListener->onCommand(
    '/start',
    function (
        \BelkaTech\VkTeamsBot\Bot $bot,
        \BelkaTech\VkTeamsBot\Event\EventDto $event,
    ): void {
        // handle /start command
    },
);

// Start long polling (must be called after all handlers are registered)
$botEventListener->listen(
    pollTime: 30,
    onException: function (
        \Exception $exception,
        \BelkaTech\VkTeamsBot\Event\EventDto $event
    ): void {
        // Log the error
        $this->logger->error('Some text', [
            'event_id' => $event->eventId,
            'event_type' => $event->type,
            'event_payload' => $event->payload,
            'exception' => $exception,
        ]);
        error_log($exception->getMessage());

        // Or catch exception to an error reporting system
        $this->sentry->captureException($exception);

        // On exception loop continues,
        // you can re-throw the exception to force stop the loop
        throw $exception;
    },
);

// Stop the listener programmatically (e.g. from a handler)
$botEventListener->stop();
```

MethodDescription`onCommand()`Register a command handler`onMessage()`Handle new messages`onEditedMessage()`Handle edited messages`onDeletedMessage()`Handle deleted messages`onPinnedMessage()`Handle pinned messages`onUnpinnedMessage()`Handle unpinned messages`onNewChatMember()`Handle new chat members`onLeftChatMember()`Handle members leaving`onCallbackQuery()`Handle callback queries`listen()`Start long polling`stop()`Stop the listenerIf the `pcntl` extension is available, `SIGTERM` and `SIGINT` signals are handled automatically for graceful shutdown. Without `pcntl`, use `$botEventListener->stop()` from a handler to stop the loop.

### Keyboard

[](#keyboard)

```
$keyboard = new \BelkaTech\VkTeamsBot\Keyboard\Keyboard();
$keyboard->addRow([
    new \BelkaTech\VkTeamsBot\Keyboard\Button(
        text: 'OK',
        callbackData: 'confirm',
        style: \BelkaTech\VkTeamsBot\Enum\ButtonStyleEnum::Primary,
    ),
    new \BelkaTech\VkTeamsBot\Keyboard\Button(
        text: 'Cancel',
        callbackData: 'cancel',
        style: \BelkaTech\VkTeamsBot\Enum\ButtonStyleEnum::Attention,
    ),
]);

$bot->messages->sendText(
    chatId: '123456',
    text: 'Confirm?',
    inlineKeyboardMarkup: $keyboard,
);
```

### LoggingHttpClient

[](#logginghttpclient)

Decorator for a PSR-18 client that logs requests and responses:

```
$loggingClient = new \BelkaTech\VkTeamsBot\Http\LoggingHttpClient(
    $psrHttpClient,
    $psrLogger,
);
```

Parse Mode
----------

[](#parse-mode)

`HTML` is used by default. You can switch to `MarkdownV2`:

```
$bot = new \BelkaTech\VkTeamsBot\Bot(
    httpClient: $httpClient,
    parseMode: \BelkaTech\VkTeamsBot\Enum\ParseModeEnum::MarkdownV2,
);
```

You can also specify `parseMode` for an individual message:

```
$bot->messages->sendText(
    chatId: '123456',
    text: '**bold**',
    parseMode: \BelkaTech\VkTeamsBot\Enum\ParseModeEnum::MarkdownV2,
);
```

Development
-----------

[](#development)

```
make setup   # build image, start container, install dependencies
make test    # run tests
make phpstan # run static analysis
make shell   # enter the container
```

Other commands: `make up`, `make down`, `make build`, `make install`.

Alternatives
------------

[](#alternatives)

-
-
-
-

License
-------

[](#license)

- `PHP VK Teams Bot` package is open-sourced software licensed under the [MIT license](LICENSE) by [BelkaCar](https://belkacar.ru).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Total

4

Last Release

93d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3fddc40462126bbc119e373ed6a3f942a90a400f30c076c447c0625b841c4ef?d=identicon)[antonkomarev](/maintainers/antonkomarev)

---

Top Contributors

[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (13 commits)")

---

Tags

bot-apiicqicq-botmailru-teamsphp-botvk-botvk-bot-apivk-teamsvk-teams-botvk-workspace

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/belka-tech-php-vk-teams-bot/health.svg)

```
[![Health](https://phpackages.com/badges/belka-tech-php-vk-teams-bot/health.svg)](https://phpackages.com/packages/belka-tech-php-vk-teams-bot)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

84735.1k](/packages/flow-php-flow)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60315.4M74](/packages/mollie-mollie-api-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k6](/packages/theodo-group-llphant)

PHPackages © 2026

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