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 codecov

Dialogs

Dialogs Plugin for Telegram Bot API PHP SDK

A powerful extension for Telegram Bot API PHP SDK v3.1+ that enables dialog-based interactions in your Telegram bots.

Table of Contents

About

This package is a maintained fork of the original Telegram Bot Dialogs package, updated to support Telegram Bot API PHP SDK v3, PHP 8+, and modern Laravel features. Our focus is on stability, developer experience, and code readability.

Why This Fork?

The 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.

Features

Scope of the package

Any bot app basically listens to Updates from Telegram API (using your webhook endpoint or by pulling these updates on any trigger, like cron) and sends messages back.

This package helps to implement a dialog mode for your bot: for a given Update, check whether the Update belongs to an already activated Dialog and if there is, run the next step of the Dialog.

This package doesn't solve the task to activate Dialogs for a given Update—you need to implement this logic in your app. Different apps may have different strategies to activate Dialogs (e.g. by commands, by message content, by message type, by user_id, etc.). The package provides an API to activate Dialogs and run the next step for the active Dialog.

Installation

Install via Composer:

Laravel Integration

  1. The package automatically registers \KootLabs\TelegramBotDialogs\Laravel\DialogsServiceProvider

  2. Publish the configuration:

This creates config/telegramdialogs.php with these environment variables:

Framework-agnostic Usage

For non-Laravel applications, see our framework-agnostic guide.

Basic Usage

1. Creating a Dialog

Create a dialog class extending Dialog:

2. Setup Webhook Handler

In this example, the Dialog is activated by a command. You can also activate dialogs based on other triggers (like an Update/Message type, or a work inside a Message).

2.1. Setting up a Telegram Command

Create a command to activate your dialog (Laravel example):

2.2. Webhook Handler Setup

Handle webhook updates in your controller:

Advanced Usage

Dialog Class API

DialogManager API

The DialogManager handles:

Laravel users can use the Dialogs facade:

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Testing

Run the test suite:

License

This package is open-sourced software licensed under the MIT license.

Roadmap

Tasks planned for v1.0:

Backward Compatibility Promise

We follow Semver 2.0. Breaking changes are only introduced in major versions.

Note:


All versions of telegram-bot-dialogs with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 ....