Download the PHP package php-telegram-bot/telegram-bot-manager without Composer

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

PHP Telegram Bot Manager

Join the bot support group on Telegram

Scrutinizer Code Quality Codecov Tests Status

Latest Stable Version Dependencies Total Downloads License

This project builds on top of PHP Telegram Bot and as such, depends on it!

The main purpose of this mini-library is to make the interaction between your webserver and Telegram easier. I strongly suggest your read the PHP Telegram Bot instructions first, to understand what this library does exactly.

Installation and usage is pretty straight forward:

Require this package with Composer

NOTE: This will automatically also install PHP Telegram Bot into your project (if it isn't already).

Advanced: Due to the fact that the core library is not a stable version yet, this project is partly locked to the core version, to ensure reliable functioning.

It is possible however, to override the core version that this library requires:

This example will pull the master version of the core library, making it appear to be version 0.81, which then satisfies the requirement.

Performing actions

What use would this library be if you couldn't perform any actions?!

There are a few parameters available to get things rolling:

Parameter Description
s secret: This is a special secret value defined in the main manager.php file.
This parameter is required to call the script via browser!
a action: The actual action to perform. (handle (default), webhookinfo, cron, set, unset, reset)
handle executes the getUpdates method; webhookinfo to get result from getWebhookInfo, cron executes cron commands; set / unset / reset the webhook.
l loop: Number of seconds to loop the script for (used for getUpdates method).
This would be used mainly via CLI, to continually get updates for a certain period.
i interval: Number of seconds to wait between getUpdates requests (used for getUpdates method, default is 2).
This would be used mainly via CLI, to continually get updates for a certain period, every i seconds.
g group: Commands group for cron (only used together with cron action, default group is default).
Define which group of commands to execute via cron. Can be a comma separated list of groups.

via browser

Simply point your browser to the manager.php file with the necessary GET parameters:

Webhook

Set, unset and reset the webhook:

getUpdates

Handle updates once:

Handle updates for 30 seconds, fetching every 5 seconds:

cron

Execute commands via cron:

via CLI

When using CLI, the secret is not necessary (since it could just be read from the file itself).

Call the manager.php file directly using php and pass the parameters:

Webhook

Set, unset and reset the webhook:

getUpdates

Handle updates once:

Handle updates for 30 seconds, fetching every 5 seconds:

cron

Execute commands via cron:

Create the manager PHP file

You can name this file whatever you like, it just has to be somewhere inside your PHP project (preferably in the root folder to make things easier). (Let's assume our file is called manager.php)

Let's start off with a simple example that uses the webhook method:

Set vital bot parameters

The only vital parameter is the API key:

Set extra bot parameters

Apart from the necessary API key, the bot can be easily configured using extra parameters.

Set the webhook? Enable admins? Add custom command paths?

All no problem!

The secret is a user-defined key that is required to execute any of the library's features via webhook. Best make it long, random and very unique!

For 84 random characters:

(You get 2 guesses why 84 is a good number :wink:)

Below is a complete list of all available extra parameters.

Using getUpdates method

Using the getUpdates method must not have a webhook parameter set and requires a MySQL database connection:

Now, the updates can be done either through the via CLI.

Custom getUpdates output

A callback can be defined, to override the default output when updates are handled via getUpdates.

Example of the default output:

Using custom callback that must return a string:

output:

Development

When running live bot tests on a fork, you must enter the following environment variables to your repository settings:

It probably makes sense for you to create a new dummy bot for this.

Security

See SECURITY for more information.

Donate

All work on this bot consists of many hours of coding during our free time, to provide you with a Telegram Bot library that is easy to use and extend. If you enjoy using this library and would like to say thank you, donations are a great way to show your support.

Donations are invested back into the project :+1:

Thank you for keeping this project alive :pray:


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

All versions of telegram-bot-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
longman/telegram-bot Version ^0.81
longman/ip-tools Version ^1.2
psr/log Version ^1.0|^2.0|^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 php-telegram-bot/telegram-bot-manager contains the following files

Loading the files please wait ....