Download the PHP package mk4u/tgram without Composer
On this page you can find all versions of the php package mk4u/tgram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package tgram
Short Description Lightweight Telegram Bot API SDK for PHP.
License MIT
Homepage https://github.com/al3x5dev/tgram
Informations about the package tgram
TGram PHP
Telegram Bot API SDK for PHP.
A lightweight PHP SDK for building Telegram bots with a simple, expressive API and minimal dependencies. Covers the Telegram Bot API (v10.3) with first-class entities and developer-friendly tooling:
- Entity system — every API response is mapped to an object with dynamic properties:
$message->from->first_name. - Attribute-driven commands & callbacks —
#[Command('/start')],#[Callback('action')]with argument parsing. - All update types — commands, callbacks, handlers, conversations and a middleware pipeline.
- Rich messages (Bot API 10.3 format) —
Text,RichMessageandBlockbuilders for beautiful messages. - Keyboard factory — fluent inline & reply keyboards
(
Keyboard::inline(),Keyboard::reply()). - Webhook security —
X-Telegram-Bot-Api-Secret-Tokenvalidation. - Built-in CLI — install, scaffold and manage your bot from the terminal.
[!NOTE] Before you start creating code, you must have created your bot in Telegram. Here's how to do it.
Requirements
- PHP >= 8.5
Installation
Quick start
-
Create
config.phpwith your bot token: -
Create your entry point (
index.php): -
Define a command in
bot/Commands/Start.php: -
Register your commands:
-
Choose how your bot receives updates:
-
Webhook (recommended for production — requires a public HTTPS URL):
- Long polling (no public URL needed — runs forever in the terminal):
-
Documentation
- Installation and configuration
- Command line interface
- Available methods
- Command system
- Callbacks
- Handler system
- Conversation flow
- Keyboards
- Message format
- Events logger
- Middlewares
- Rich messages
License
MIT
All versions of tgram with dependencies
mk4u/http Version ^2.0
mk4u/cache Version ^0.4.2
monolog/monolog Version ^3.10
symfony/console Version ^8.1