Download the PHP package alirezax5/telegram-base without Composer

On this page you can find all versions of the php package alirezax5/telegram-base. 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-base

TelegramBase

A modular PHP 8.1+ Telegram bot framework built on Illuminate components, with a plugin system, queue backends, session management, middleware pipeline, scheduler, migration runner, and CLI scaffolding.

Requirements

Quick Start

Bot Modes

Set BOT_MODE in .env:

Mode Description
update_direct Long-polling, process inline (default)
update_queue Long-polling, push to queue
webhook_direct Webhook, process inline
webhook_queue Webhook, push to queue
cronjob_update Cron-task polling (single slot)
cronjob_queue Cron-task queue processing (N slots)

Folder Structure

CLI Commands

Writing a Plugin

Create a file in Plugin/ — the framework auto-discovers it:

$message is the message object (not the full update) — use $message->text, $message->chat->id, etc.

Handler methods

Method Triggered when
onMessage Any text or media message
onCallback_query Inline button pressed
onCommand Slash command (e.g. /start)
before Runs before every update
after Runs after every update

Attributes

Session

Session state persists between messages, stored via the Cache driver:

Config (.env)

Keyboard Builder

Build inline or reply keyboards with a fluent API:

Middleware

Pipeline-based middleware, runs before plugins:

Built-in Middlewares

Middleware Purpose
RateLimit Sliding-window rate limiter per user
AuditLog Logs every incoming update
AdminGuard Restricts to ADMINS_WHITELIST from .env

Retry Queue

Automatic retry for failed API calls (429/5xx), with exponential backoff:

Config (.env)

Scheduler

Cron-based task scheduler. Each tick runs bin/scheduler.php (e.g. every minute via crontab):

Schedule tasks in bin/tasks.php:

Webhook Mode

Switch to BOT_MODE=webhook_direct or webhook_queue in .env:

webhook.php is the entry point — it validates IP + secret token, then dispatches.

Migration

Database schema management via Illuminate Schema builder:

Migration file example:

Config (.env)

Queue Backends

Driver Env Setting Use Case
JSON json Default, file-based, no dependencies
Redis redis High throughput, requires redis extension
Memcached memcached Distributed, requires memcached
RabbitMQ rabbitmq Enterprise messaging, requires amqp

Cache Drivers

Driver Env Setting Notes
Array array In-memory, per-process (default)
File file Persistent, uses CACHE_PATH
Redis redis Shared, high-performance
Memcached memcached Distributed cache
Database database MySQL/MariaDB table-backed

Configuration

All configuration via .env. Key groups:

Group Keys
Bot BOT_TOKEN, BOT_MODE, POLLING_*, WEBHOOK_*
Plugins PLUGINS_DIR, PLUGIN_CACHE_ENABLED, PLUGINS_RELOAD_INTERVAL
Language LANG_DRIVER, DEFAULT_LANG, LANG_DIR
Buttons BUTTONS_DIR, BUTTONS_FILE, BUTTONS_CACHE_TTL
Queue QUEUE_SAVE_TYPE, RETRY_QUEUE_DRIVER, RETRY_*
Cache CACHE_DRIVER, CACHE_PREFIX, CACHE_PATH
Session SESSION_TTL, SESSION_PREFIX
Scheduler SCHEDULER_LOCK_TTL, SCHEDULER_LOCK_TABLE
Database DATABASE_ENABLE, DB_*
Logging LOG_ENABLED, LOG_LEVEL, LOG_DIR

See .env.example for full list with defaults.

Illuminate Components

This framework reuses (not forks) these Laravel/Illuminate packages:

Package Used for
illuminate/cache Session, plugin cache, language cache, queue locks
illuminate/database Eloquent ORM, Schema builder, migrations
illuminate/pipeline Middleware pipeline
illuminate/filesystem File-based cache, filesystem utilities
illuminate/support Helpers, collections, Carbon, higher-order helpers
illuminate/contracts Interfaces (Cache, Queue, Connection)
illuminate/redis Redis cache/queue driver
illuminate/events Event dispatcher (optional)
illuminate/bus Task dispatch (optional)

License

MIT


All versions of telegram-base with dependencies

PHP Build Version
Package Version
Requires alirezax5/telegram-bot-php Version ^3.0
vlucas/phpdotenv Version ^5.6
monolog/monolog Version ^3.9
illuminate/database Version ^10.0
php-amqplib/php-amqplib Version ^2.8
symfony/filesystem Version ^7.3
illuminate/cache Version ^10.49
illuminate/filesystem Version ^10.49
illuminate/events Version ^10.49
predis/predis Version ^3.4
illuminate/redis Version ^10.49
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 alirezax5/telegram-base contains the following files

Loading the files please wait ...