Download the PHP package devrabie/php-telegram-bot-plus without Composer

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

php-telegram-bot-plus

Latest Version on Packagist Issues

A community-driven and updated fork of the popular php-telegram-bot/core library, with support for the latest Telegram Bot API features.


📖 Overview

php-telegram-bot-plus is an enhanced and actively maintained fork of the great longman/php-telegram-bot library. This project was created to continue its development after the original project stalled, ensuring full support for the latest Telegram Bot API features and providing ongoing bug fixes and improvements for the community.

Our goal is to be a drop-in replacement for existing users, while providing powerful new features for new developers.

✨ Why choose php-telegram-bot-plus?

📦 Installation

🚀 Using the Redis Helper

This library provides a simple helper to integrate a Redis client, allowing you to easily use Redis for your custom data persistence needs (e.g., storing user states, settings, caching). The library itself remains stateless.

1. Enable Redis

In your main bot file (e.g., hook.php or your script that handles updates):

2. Use Redis in Your Commands

You can access the shared Redis client instance from any command class using automatic dependency injection. Simply add a redis property to your command class and it will be automatically populated:

You can also access the Redis instance statically from anywhere in your project:

3. Prevent Duplicate Updates

Enabling Redis also activates the built-in duplicate update prevention mechanism. This is useful when the bot receives the same update multiple times due to timeouts or retries from Telegram.

When Redis is enabled:

  1. The library checks if the update_id exists in Redis.
  2. If it exists, the update is ignored, and a fake success response is returned to Telegram to stop retries.
  3. If it doesn't exist, the update_id is stored in Redis with a retention time (TTL) of 60 seconds.

You can customize the retention time (in seconds):


⚙️ Advanced Configuration

Request Timeout

To prevent your server from hanging on slow Telegram API requests (e.g., cURL error 28), you can set a custom timeout for the HTTP client. The default timeout is 60 seconds.


🔐 Webhook Secret Token

For enhanced security, you can set a secret token when you set your webhook. Telegram will then send this token in the X-Telegram-Bot-Api-Secret-Token header with every update. This library can automatically validate this token for you.

1. Set the Webhook with a Secret Token

When setting your webhook, provide a secret_token:

2. Configure Your Bot to Verify the Token

In your webhook handler (e.g., hook.php), set the same secret token on your Telegram object. The library will then automatically check the header on incoming requests and throw an exception if the token is missing or invalid.

This ensures that only requests from Telegram with the correct secret token are processed by your bot.


🙏 Acknowledgments A huge thanks to the original developers of longman/php-telegram-bot for their incredible work that formed the foundation of this project.


All versions of php-telegram-bot-plus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-pdo Version *
ext-curl Version *
ext-json Version *
ext-mbstring 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 devrabie/php-telegram-bot-plus contains the following files

Loading the files please wait ...