amirxd / ultra-telegram
A clean, extensible PHP client for the Telegram Bot API powered by PHP Ultra Request.
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- amirxd/php-ultra-request: dev-main
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-03 18:02:09 UTC
README
A modern, extensible PHP client for the Telegram Bot API. Powered by PHP Ultra Request.
UltraTelegram provides a lightweight, structured interface to Telegram's Bot API while delegating HTTP transport, middleware and concurrent requests to PHP Ultra Request.
Highlights
- Dynamic access to Bot API methods, including newly added endpoints.
- JSON requests and multipart uploads, including nested attach:// media.
- File downloads through a streaming downloader.
- Long polling, update dispatching and webhook request validation.
- Concurrent API calls with callMany().
- Read-only response objects and dedicated API/transport exceptions.
- PHP 8.0+ and PSR-4 autoloading.
Requirements
- PHP 8.0+
- ext-curl and ext-json
- amirxd/php-ultra-request
Installation
Until a stable Packagist release is available, add both GitHub VCS repositories to your application's composer.json:
{
"repositories": [
{"type": "vcs", "url": "https://github.com/amirxdcy4455/UltraTelegram"},
{"type": "vcs", "url": "https://github.com/amirxdcy4455/UltraRequest"}
],
"require": {
"amirxd/ultra-telegram": "dev-main",
"amirxd/php-ultra-request": "dev-main"
}
}
Then run composer update.
Quick start
use Amirxd\UltraTelegram\UltraTelegram; $bot = new UltraTelegram(getenv('TELEGRAM_BOT_TOKEN')); $response = $bot->sendMessage([ 'chat_id' => 123456789, 'text' => 'Hello from UltraTelegram!' ]); $messageId = $response->getResultObject()?->get('message_id');
Keep your bot token in an environment variable or secret manager. Never commit it to source control.
Documentation
The README is intentionally short. Detailed API usage and implementation notes are maintained separately:
- Documentation index
- Getting started
- API methods and requests
- Responses and errors
- File uploads and downloads
- Polling and update dispatching
- Webhooks
- Keyboard helpers
- Architecture and security
- Telegram Bot API compatibility
The docs/wiki directory contains standalone Wiki-ready pages. GitHub Wiki uses a separate Git repository; these source pages are kept here for version control.
Examples
Runnable examples are available in examples/.
Tests
composer test
License
MIT. See LICENSE.