{"id":47616737,"url":"https://github.com/belka-tech/php-vk-teams-bot","last_synced_at":"2026-04-01T21:32:19.972Z","repository":{"id":345894179,"uuid":"1187266889","full_name":"belka-tech/php-vk-teams-bot","owner":"belka-tech","description":"PHP client for VK Teams Bot API. Provides a typed interface for sending messages, managing chats, and receiving events via long polling.","archived":false,"fork":false,"pushed_at":"2026-03-21T18:37:08.000Z","size":42,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-21T22:16:07.261Z","etag":null,"topics":["bot-api","icq","icq-bot","mailru-teams","php-bot","vk-bot","vk-bot-api","vk-teams","vk-teams-bot","vk-workspace"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/belka-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-20T14:28:51.000Z","updated_at":"2026-03-21T17:12:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/belka-tech/php-vk-teams-bot","commit_stats":null,"previous_names":["belka-tech/php-vk-teams-bot"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/belka-tech/php-vk-teams-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belka-tech%2Fphp-vk-teams-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belka-tech%2Fphp-vk-teams-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belka-tech%2Fphp-vk-teams-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belka-tech%2Fphp-vk-teams-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/belka-tech","download_url":"https://codeload.github.com/belka-tech/php-vk-teams-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belka-tech%2Fphp-vk-teams-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot-api","icq","icq-bot","mailru-teams","php-bot","vk-bot","vk-bot-api","vk-teams","vk-teams-bot","vk-workspace"],"created_at":"2026-04-01T21:32:17.074Z","updated_at":"2026-04-01T21:32:19.957Z","avatar_url":"https://github.com/belka-tech.png","language":"PHP","readme":"# PHP VK Teams Bot API (aka ICQ Bot)\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/belka-tech/php-vk-teams-bot\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/belka-tech/php-vk-teams-bot.svg?style=flat-square\u0026label=latest%20version\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/belka-tech/php-vk-teams-bot/actions/workflows/tests.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/belka-tech/php-vk-teams-bot/tests.yml?style=flat-square\" alt=\"Build\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/belka-tech/php-vk-teams-bot/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/belka-tech/php-vk-teams-bot.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nPHP client for VK Teams Bot API. Provides a typed interface\nfor sending messages, managing chats, and receiving events via\nlong polling.\n\nOfficial documentation: https://teams.vk.com/botapi/\n\n## Requirements\n\n- PHP 8.2+\n- PSR-18 HTTP Client (`psr/http-client`)\n- PSR-17 HTTP Factories (`psr/http-factory`)\n- PSR-3 Logger (`psr/log`) — optional, for `LoggingHttpClient`\n\n## Installation\n\n```bash\ncomposer require belka-tech/php-vk-teams-bot\n```\n\n## Quick Start\n\n```php\n$bot = new \\BelkaTech\\VkTeamsBot\\Bot(\n    new \\BelkaTech\\VkTeamsBot\\Http\\HttpClient(\n        baseUri: 'https://api.icq.net/bot',\n        token: 'YOUR_BOT_TOKEN',\n        client: new \\GuzzleHttp\\Client(\n            [\n                'connect_timeout' =\u003e 4,\n                'timeout' =\u003e 15,\n                'http_errors' =\u003e false,\n            ],\n        ),\n        requestFactory: new \\GuzzleHttp\\Psr7\\HttpFactory(),\n        streamFactory: new \\GuzzleHttp\\Psr7\\HttpFactory(),\n    ),\n);\n\n// Send a text message\n$bot-\u003emessages-\u003esendText(\n    chatId: 'YOUR_CHAT_ID',\n    text: '\u003cb\u003eHello!\u003c/b\u003e',\n);\n```\n\n## API\n\n### Messages (`$bot-\u003emessages`)\n\n| Method                   | Description                       |\n|--------------------------|-----------------------------------|\n| `sendText()`             | Send a text message               |\n| `sendFile()`             | Send a file                       |\n| `sendVoice()`            | Send a voice message              |\n| `editText()`             | Edit a message                    |\n| `deleteMessages()`       | Delete messages                   |\n| `answerCallbackQuery()`  | Answer a callback query           |\n| `pinMessage()`           | Pin a message                     |\n| `unpinMessage()`         | Unpin a message                   |\n| `filesGetInfo()`         | Get file information              |\n\n### Chats (`$bot-\u003echats`)\n\n| Method             | Description                        |\n|--------------------|------------------------------------|\n| `create()`         | Create a chat                      |\n| `addMembers()`     | Add members                        |\n| `removeMembers()`  | Remove members                     |\n| `sendAction()`     | Send an action (typing, etc.)      |\n| `getInfo()`        | Get chat information               |\n| `getAdmins()`      | List administrators                |\n| `getMembers()`     | List members                       |\n| `blockUser()`      | Block a user                       |\n| `unblockUser()`    | Unblock a user                     |\n| `resolvePending()` | Approve/reject join requests       |\n| `setTitle()`       | Set chat title                     |\n| `setAvatar()`      | Set chat avatar                    |\n| `setAbout()`       | Set chat description               |\n| `setRules()`       | Set chat rules                     |\n\n### Events API (`$bot-\u003eevents`)\n\n| Method  | Description                        |\n|---------|------------------------------------|\n| `get()` | Fetch events (long polling)        |\n\n### Event Listener\n\nLong polling with event dispatching:\n\n```php\n$botEventListener = new \\BelkaTech\\VkTeamsBot\\BotEventListener(\n    bot: $bot,\n);\n\n// Register event handlers\n$botEventListener-\u003eonMessage(\n    function (\n        \\BelkaTech\\VkTeamsBot\\Bot $bot,\n        \\BelkaTech\\VkTeamsBot\\Event\\EventDto $event,\n    ): void {\n        $bot-\u003emessages-\u003esendText(\n            chatId: $event-\u003epayload['chat']['chatId'],\n            text: 'Pong!',\n        );\n    },\n);\n\n$botEventListener-\u003eonCommand(\n    '/start',\n    function (\n        \\BelkaTech\\VkTeamsBot\\Bot $bot,\n        \\BelkaTech\\VkTeamsBot\\Event\\EventDto $event,\n    ): void {\n        // handle /start command\n    },\n);\n\n// Start long polling (must be called after all handlers are registered)\n$botEventListener-\u003elisten(\n    pollTime: 30,\n    onException: function (\n        \\Exception $exception,\n        \\BelkaTech\\VkTeamsBot\\Event\\EventDto $event\n    ): void {\n        // Log the error\n        $this-\u003elogger-\u003eerror('Some text', [\n            'event_id' =\u003e $event-\u003eeventId,\n            'event_type' =\u003e $event-\u003etype,\n            'event_payload' =\u003e $event-\u003epayload,\n            'exception' =\u003e $exception,\n        ]);\n        error_log($exception-\u003egetMessage());\n        \n        // Or catch exception to an error reporting system\n        $this-\u003esentry-\u003ecaptureException($exception);\n        \n        // On exception loop continues,\n        // you can re-throw the exception to force stop the loop\n        throw $exception;\n    },\n);\n\n// Stop the listener programmatically (e.g. from a handler)\n$botEventListener-\u003estop();\n```\n\n| Method              | Description                        |\n|---------------------|------------------------------------|\n| `onCommand()`       | Register a command handler         |\n| `onMessage()`       | Handle new messages                |\n| `onEditedMessage()` | Handle edited messages             |\n| `onDeletedMessage()`| Handle deleted messages            |\n| `onPinnedMessage()` | Handle pinned messages             |\n| `onUnpinnedMessage()`| Handle unpinned messages          |\n| `onNewChatMember()` | Handle new chat members            |\n| `onLeftChatMember()`| Handle members leaving             |\n| `onCallbackQuery()` | Handle callback queries            |\n| `listen()`          | Start long polling                 |\n| `stop()`            | Stop the listener                  |\n\nIf the `pcntl` extension is available, `SIGTERM` and `SIGINT` signals are handled automatically for graceful shutdown.\nWithout `pcntl`, use `$botEventListener-\u003estop()` from a handler to stop the loop.\n\n### Keyboard\n\n```php\n$keyboard = new \\BelkaTech\\VkTeamsBot\\Keyboard\\Keyboard();\n$keyboard-\u003eaddRow([\n    new \\BelkaTech\\VkTeamsBot\\Keyboard\\Button(\n        text: 'OK',\n        callbackData: 'confirm',\n        style: \\BelkaTech\\VkTeamsBot\\Enum\\ButtonStyleEnum::Primary,\n    ),\n    new \\BelkaTech\\VkTeamsBot\\Keyboard\\Button(\n        text: 'Cancel',\n        callbackData: 'cancel',\n        style: \\BelkaTech\\VkTeamsBot\\Enum\\ButtonStyleEnum::Attention,\n    ),\n]);\n\n$bot-\u003emessages-\u003esendText(\n    chatId: '123456',\n    text: 'Confirm?',\n    inlineKeyboardMarkup: $keyboard,\n);\n```\n\n### LoggingHttpClient\n\nDecorator for a PSR-18 client that logs requests and responses:\n\n```php\n$loggingClient = new \\BelkaTech\\VkTeamsBot\\Http\\LoggingHttpClient(\n    $psrHttpClient,\n    $psrLogger,\n);\n```\n\n## Parse Mode\n\n`HTML` is used by default. You can switch to `MarkdownV2`:\n\n```php\n$bot = new \\BelkaTech\\VkTeamsBot\\Bot(\n    httpClient: $httpClient,\n    parseMode: \\BelkaTech\\VkTeamsBot\\Enum\\ParseModeEnum::MarkdownV2,\n);\n```\n\nYou can also specify `parseMode` for an individual message:\n\n```php\n$bot-\u003emessages-\u003esendText(\n    chatId: '123456',\n    text: '**bold**',\n    parseMode: \\BelkaTech\\VkTeamsBot\\Enum\\ParseModeEnum::MarkdownV2,\n);\n```\n\n## Development\n\n```bash\nmake setup   # build image, start container, install dependencies\nmake test    # run tests\nmake phpstan # run static analysis\nmake shell   # enter the container\n```\n\nOther commands: `make up`, `make down`, `make build`, `make install`.\n\n## Alternatives\n\n- https://github.com/dasshit/php-icqbot\n- https://github.com/mail-ru-im/bot-java\n- https://github.com/mail-ru-im/bot-python\n- https://github.com/mail-ru-im/bot-golang\n\n## License\n\n- `PHP VK Teams Bot` package is open-sourced software licensed under the [MIT license](LICENSE) by [BelkaCar](https://belkacar.ru).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelka-tech%2Fphp-vk-teams-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelka-tech%2Fphp-vk-teams-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelka-tech%2Fphp-vk-teams-bot/lists"}