Download the PHP package yabx/telegram without Composer

On this page you can find all versions of the php package yabx/telegram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telegram

yabx/telegram

PHP SDK for the Telegram Bot API. Typed request/response objects, Guzzle HTTP client, and coverage aligned with Bot API 10.2 (July 2026).

Requirements

Installation

Features

Quick start

Client options

Send messages (text, parse mode, reply)

Inline keyboard

Reply keyboard (custom keyboard)

Photo from disk (multipart upload)

If the path exists on disk, the client opens the file and sends it as multipart automatically:

Webhooks

Register and inspect the webhook:

Handle an incoming POST body (typical PHP endpoint):

Then branch on the update payload:

Long polling (getUpdates)

Low-level request()

Useful for new API parameters before a dedicated method exists, or rare calls:

Objects with a toArray() method are normalized automatically. Upload methods on BotApi already set multipart where needed.

Last raw API response

After each call, the decoded JSON envelope (including ok, result, description, etc.) is available:

Error handling

Failed Bot API responses throw Yabx\Telegram\Exception with Telegram’s error_code as the exception code when present:

Project layout

Path Role
src/BotApi.php Client: all Bot API methods + request()
src/Objects/ Telegram types (Message, Update, keyboards, …)
src/Enum/ Helpers such as ChatAction, etc.
tests/ PHPUnit test suite and JSON fixtures

Testing

Optional coverage report (requires the PCOV extension locally):

HTML report in build/coverage/:

If PCOV is not installed, composer test:coverage prints installation hints instead of a cryptic PHPUnit error. CI collects coverage with PCOV on PHP 8.3 (job coverage in .github/workflows/tests.yml).

Tests use PHPUnit 10.5+ (PHP 8.1) or 11+ (PHP 8.2+) with Guzzle MockHandler for HTTP integration tests. Fixtures live in tests/Fixtures/.

Coverage phases

Phase Scope Status
1 Infrastructure, Utils, BotApi, core objects done
2 All RichText / RichBlock types, update variants done
3 Polymorphic dispatchers (ChatMember, MessageOrigin, …) done
4 Round-trip manifest (tests/Fixtures/roundtrip/) done — 331 leaf classes (~93%); dispatchers tested separately
5 Composite variant tests (ChatFullInfo, Message, ExternalReplyInfo) done
6 All Update webhook variants done — 22 fixtures
7 BotApi integration (request serialization, response parsing) done — 57 tests
8 Composite variants (Message quote/forward, ExternalReplyInfo media) done
9 API response snapshots (tests/Fixtures/api_responses/) done — 7 fixtures
10 Shared MocksBotApi trait, multipart uploads, forum topic variants done
11 Media send methods, payments, ChatFullInfo private, service messages done
12 Location/contact/video note, stars, migration/members, getUpdatefromRequest done
13 Paid media, batch delete/copy, ChatBoostSource dispatcher, chat service messages done
14 Chat actions, reactions, join requests, sticker set snapshot, chat event messages done
15 Live location, menu button, custom emoji, invite link snapshot, Update round-trip done
16 Live photo, forum topics, games, restrict member, service message variants done — 79 BotApi tests, 13 snapshots
17 Chat admin, forum/general topics, stickers, bot profile/commands, join-query done — 113 BotApi tests, ~69% BotApi.php lines
18 Business, stories, gifts/stars, payments, verification, managed bot, downloadFile done — 127 BotApi tests, ~99% BotApi.php lines
19 Deep Message / ChatFullInfo / Update variants done — 42 message fixtures, Message ~67% lines
20 BotApi edge cases: multipart, downloadFile, logging, transport errors done — BotApiEdgeCasesTest
21 API snapshots: business, gifts, boosts, invoice, extended chat done — 18 snapshots
22 Polymorphic dispatch + sendPoll / InputPollMedia contract done
23 PHPStan level 2, coverage threshold 57%, CI static analysis done — composer phpstan
24 CHANGELOG.md, README examples for Bot API 10.2 features done

InputPollMedia / InputPollOptionMedia are PHP interfaces; implementing classes (InputMediaPhoto, InputMediaLink, …) are covered in the round-trip manifest and via sendPoll contract tests.

Static analysis and coverage gate

Bot API 10.2 examples

Ephemeral messages

Rich message blocks

Bot API 10.1 examples

Business connection

Stories (managed business account)

Gifts and Stars

Rich messages

To add coverage for a new object, append an entry to the appropriate file under tests/Fixtures/roundtrip/ (merged by roundtrip.php):

License

MIT (see composer.json).

See also


All versions of telegram with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-curl Version *
guzzlehttp/guzzle Version ^7.9
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yabx/telegram contains the following files

Loading the files please wait ...