PHPackages                             dnezh/telegram-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. dnezh/telegram-api

ActiveLibrary[API Development](/categories/api)

dnezh/telegram-api
==================

A complete Telegram bot API implementation written in PHP, with support for inline bots!

v3.6.0(5y ago)076MITPHPPHP &gt;=7.0.0

Since Jan 6Pushed 2y agoCompare

[ Source](https://github.com/DmitrijNezh/telegram-api)[ Packagist](https://packagist.org/packages/dnezh/telegram-api)[ RSS](/packages/dnezh-telegram-api/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (10)Versions (68)Used By (0)

[![PHP 7 Telegram Bot API Library](https://github.com/unreal4u/telegram-api/raw/master/examples/binary-test-data/logo-php7-telegram-bot-api-small.png?raw=true)](https://github.com/unreal4u/telegram-api/wiki/100-stars!)

Telegram API Library
====================

[](#telegram-api-library)

[![Latest Stable Version](https://camo.githubusercontent.com/b6699977843372cfb413c200968b67c1cf08a0c92cf4f18611b57e416c9aa8b0/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f74656c656772616d2d6170692f762f737461626c65)](https://packagist.org/packages/unreal4u/telegram-api)[![Total Downloads](https://camo.githubusercontent.com/b5dd14fa3fe49b8081d281cf00ebb4a22662014b684544fa70798fbd09615a90/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f74656c656772616d2d6170692f646f776e6c6f616473)](https://packagist.org/packages/unreal4u/telegram-api)[![Build Status](https://camo.githubusercontent.com/51c181ab8f4168190636a8c061a08eb77bfa808226f4ef74f50137c12261ef87/68747470733a2f2f7472617669732d63692e6f72672f756e7265616c34752f74656c656772616d2d6170692e737667)](https://travis-ci.org/unreal4u/telegram-api)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8f739af412cea692630fa4f576daa6131da08dfbf4d5f8a541e372e35a9b3a1d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756e7265616c34752f74656c656772616d2d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/unreal4u/telegram-api/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/ef420edc9e30c0c897ea9b34af8c4da5d550467b8104f195c6dc5711688af7c0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756e7265616c34752f74656c656772616d2d6170692f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/unreal4u/telegram-api/?branch=master)[![License](https://camo.githubusercontent.com/aeb102aaea1e7b6d8a7b3ca801880119f2bede997f62e1407f71ef2112eeca0c/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f74656c656772616d2d6170692f6c6963656e7365)](https://packagist.org/packages/unreal4u/telegram-api)

This is a PHP7 bot API implementation for Telegram implementing the **vast majority** of [Bot API up until v4.7](https://core.telegram.org/bots/api-changelog#march-30-2020). The only thing it does not implement is Telegram Passport which was introduced in [Bot API v4.0](https://core.telegram.org/bots/api#july-26-2018). It is unlikely to be introduced as it may introduce security vulnerabilities. However, if you think you have a strong case for the need, feel free to let me know.

### About this package

[](#about-this-package)

- Enables you to anything supported by the Telegram Bot API: messages, stickers, location, inline bots and any other supported method via PHP to a Telegram user (either direct conversation, channel, group or supergroup).
- Respects and implements the default types and methods made by Telegram itself. Have any doubts about any method? [Just check the original documentation](https://core.telegram.org/bots/api), this implementation will not differ too much.
- Doesn't need any mandatory dependencies, except for ReactPHP, which you can inject if you already use it elsewhere.
- **Full** inline bots support.
- **Full** support for payment system.

Known bugs
----------

[](#known-bugs)

[![Telegram](https://camo.githubusercontent.com/41dcefd4a388dfd0a68ec051a70ecd6b4fb955dce5beed4df7fb68295d92733e/687474703a2f2f7472656c6c6f626f742e646f6f6d646e732e6f72672f74656c656772616d62616467652e737667)](https://t.me/PHPBotAPI)

The only thing that is not included in this library (yet) is the Passport support. This was an ongoing development, but it ended up being a lot more work than initially thought, so if someone wants to pick that up... be my guest!

All other known bugs can be found in the form of issues or pull requests. Found a new bug? Feel free to [submit a PR](https://github.com/unreal4u/telegram-api/pulls) or [create an issue](https://github.com/unreal4u/telegram-api/issues)! Not sure if you've found a new bug? You can always ask in the [special group](https://t.me/PHPBotAPI) :)

Roadmap
-------

[](#roadmap)

- v4 (no branch yet) will be the next major release. [More information](https://github.com/unreal4u/telegram-api/projects/5).
- v3 (master branch) is the current active branch.
- v2 (v2 branch) is deprecated and no new work will be done there.
- v1 is deprecated and no new work will be done there.
- v0 is deprecated and no new work will be done there.

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

[](#installation)

[![Total Downloads](https://camo.githubusercontent.com/b5dd14fa3fe49b8081d281cf00ebb4a22662014b684544fa70798fbd09615a90/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f74656c656772616d2d6170692f646f776e6c6f616473)](https://packagist.org/packages/unreal4u/telegram-api)

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. [Read this for installation instructions](https://getcomposer.org/doc/00-intro.md).
The preferred (and only for now) installation method is Composer, so add the following to your composer.json:

```
{
  "require": {
    "unreal4u/telegram-api": "~3.4"
  }
}
```

If you are not familiar with it, I suggest reading the basic usage manual [located here](https://getcomposer.org/doc/01-basic-usage.md).

### Tip for Russian users

[](#tip-for-russian-users)

In order to use a proxy, you can use the  package and pass on the following options to the Client:

```
