Download the PHP package texhub/telegram without Composer
On this page you can find all versions of the php package texhub/telegram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download texhub/telegram
More information about texhub/telegram
Files in texhub/telegram
Package telegram
Short Description Full-featured, multi-tenant Telegram Bot API & Telegram Business SDK for any PHP framework with first-class Laravel support: messages, media, keyboards, webhooks, long polling and more.
License MIT
Homepage https://texhub.pro
Informations about the package telegram
TexHub · Telegram
English · Русский
A full-featured, multi-tenant Telegram Bot API & Telegram Business SDK for any PHP framework — built to be beginner-friendly: write a method named after each command, reply with a fluent $this->chat, and manage bots from the terminal.
The entire Bot API is reachable via
->call(), with typed helpers and builders for the common cases. Secure by default: webhook secret-token verification and token scrubbing in errors.Full method reference & cookbook → — every method with copy-paste examples and example responses.
Reference: https://core.telegram.org/bots/api
Features
- Easy bot builder — extend
UpdateHandler, writepublic function start()for/start - Fluent replies —
$this->chat->message('Hi')->html()->keyboard(...)->send() - Keyboards — inline & reply builders, every button type (web app, copy text, login, …)
- Messages & media — text, photo, video, audio, voice, document, sticker, location, contact, poll, dice
- Edit / delete / forward / copy, reactions, pin, chat actions
- Files — upload local files,
getFile, download bytes/to disk - Payments (invoices & Telegram Stars) and Games
- Webhooks — secret-token verification + a rich
Updateparser for everything that arrives - Telegram Business — business updates + send on behalf of a connection
- Multi-tenant — many bots; store them (and every chat) in your DB
- Artisan commands — add bots, set/unset webhooks, list bots
- Full coverage —
->call('anyMethod', [...])for everything else; fully unit-tested
Installation
Requirements: PHP ≥ 8.2 with curl, json, hash.
Build a bot (the easy way)
Extend UpdateHandler and write a method named after each command. The argument is
whatever follows it (e.g. a referral code from /start REF123). Reply with the fluent
$this->chat:
Wire it in your webhook — one line (it verifies the secret, parses and dispatches):
Override onText, onPhoto, onVideo, onDocument, onVoice, onAudio, onAnimation,
onSticker, onLocation, onContact, onCallbackQuery, onInlineQuery, onPreCheckoutQuery,
onMessage, onOther — and any commandName().
Sending directly (without a handler)
See the full reference for every method (payments, games, chat admin, …).
Webhooks
The incoming Update exposes everything: text(), photo()/photoFileId(), video(),
document(), voice(), audio(), animation(), sticker(), location(), contact(),
venue(), poll(), dice(), caption(), chatId(), fromId(), messageId(), fileId(),
callbackQuery(), isCommand(), isBusiness(), businessConnectionId().
Telegram Business
Multi-tenant (many bots)
Laravel
Auto-discovered. Publish config (+ optional migrations for storing bots & chats):
Artisan commands
Facade
Models (store bots & chats)
Webhook controller
Exclude the webhook route from CSRF (
validateCsrfTokens(except: ['telegram/webhook'])).
Testing
Architecture
License
MIT © TexHub Pro — built by Mahmudi Shodmehr.
All versions of telegram with dependencies
ext-curl Version *
ext-json Version *
ext-hash Version *