Download the PHP package koot-labs/telegram-bot-dialogs without Composer

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

CI Backward compatibility check Type coverage Psalm level

Dialogs

Dialogs plugin for Telegram Bot API PHP SDK

The extension for Telegram Bot API PHP SDK v3.1+ that allows to implement dialogs for telegram bots.

About this fork

Original package is not maintained anymore and does not support Telegram Bot API PHP SDK v3. The goal of the fork is to maintain the package compatible with the latest Telegram Bot API PHP SDK, PHP 8+ and Laravel features, focus on stability, better DX and readability.

Installation

You can install the package via Composer:

The package will automatically register itself.

You can publish the config file with:

It will create config/telegram.php file that uses the following env variables:

Usage

  1. Create a Dialog class
  2. Create a Telegram command to activate Dialog from the Command.
  3. Setup your controller class to proceed active Dialog on income webhook request.

1. Create a Dialog class

Each dialog should be implemented as class that extends basic Dialog as you can see in HelloExampleDialog or the code bellow:

2. Create a Telegram command

To initiate a dialog please use DialogManager (or, if you use Laravel, Dialogs Facade) — it will care about storing and recovering Dialog instance state between steps/requests. To execute the first and next steps please call Dialogs::proceed() method with update object as an argument. Also, it is possible to use dialogs with Telegram commands and DI through type hinting.

3. Setup your controller

Process request inside your Laravel webhook controller:

Dialog class API

DialogManager class API

DialogManager is in charge of:

For Laravel apps, the package provides Dialogs Facade, that proxies calls to DialogManager class.

DialogManager public API:

ToDo

Tasks to do for v1.0:

Backward compatibility promise

Dialogs package uses Semver 2.0. This means that versions are tagged with MAJOR.MINOR.PATCH. Only a new major version will be allowed to break backward compatibility (BC).

Classes marked as @experimental or @internal are not included in our backward compatibility promise. You are also not guaranteed that the value returned from a method is always the same. You are guaranteed that the data type will not change.

PHP 8 introduced named arguments, which increased the cost and reduces flexibility for package maintainers. The names of the arguments for methods in Dialogs is not included in our BC promise.


All versions of telegram-bot-dialogs with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.2
illuminate/collections Version ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0
irazasyed/telegram-bot-sdk Version ^3.1
predis/predis Version ^1.0 || ^2.0
psr/simple-cache 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 koot-labs/telegram-bot-dialogs contains the following files

Loading the files please wait ....