Download the PHP package arodu/tebo without Composer

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

TeBo: CakePHP plugin for Telegram Bot

Latest Version GitHub Repo stars Total Downloads

TeBo is a plugin that integrates a Telegram bot into CakePHP 5 applications, allowing configuration and management of custom commands with an easy setup.

Installation

  1. Install the plugin using Composer:

  2. Load the plugin in your project:

  3. Add your Telegram bot token to the .env file, or set it as an environment variable:

Webhook Configuration

TeBo offers commands to manage the webhook setup in Telegram. To run these commands, use:

The available options are:

  1. Get Webhook URL: Displays the current webhook URL configured on the local system.
  2. Set Webhook to telegram: Sets the webhook on Telegram, linking the bot to a specific URL to receive updates.
  3. Delete Webhook from telegram: Deletes the webhook from Telegram, stopping the bot from receiving updates.
  4. Get Webhook info from telegram: Shows information about the webhook configured on Telegram, including status and connection details.
  5. Get bot info: Displays information about the bot, including the bot's name, username, and ID.

Additional Configuration (Optional)

You can add the following values to the .env file to enhance webhook functionality:

Configuring CSRF Protection

CakePHP includes built-in protection against Cross-Site Request Forgery (CSRF) attacks. However, to allow Telegram webhooks to work properly with TeBo, you need to exclude requests coming from the plugin from this protection.

To do this, adjust the middleware configuration in the src/Application.php file. Modify the middleware method to include the following logic:

[!WARNING] Why Is This Necessary? Telegram cannot send custom headers (such as CSRF tokens), which would cause webhook requests to be rejected if CSRF protection is enabled. By configuring this exclusion, we allow Telegram to interact with our application without compromising the overall security.

Bot Testing

Once the webhook and token are configured, the bot should be ready to work. You can test it on Telegram using the following commands:

Customization

To customize the bot's options, you can create a configuration file in config/tebo.php with the following structure:

[!NOTE] You can find more information about this file on config/tebo.php in the plugin's directory.

Usage

The plugin provides a default Action that can be extended to create custom actions. To create a new action, follow these steps:

  1. Create a new command class in the src/Actions directory.
  2. Extend from \TeBo\Action\Action or Implement the \TeBo\Action\ActionInterface interface.
  3. Add the command to the config/tebo.php file.

To add the command to the configuration file config/tebo.php, use the following code:

[!NOTE] After adding the command, you can test it by sending /prices to the bot.

Bake a New Action

Also, you can bake a new action using the following command:

Send an HTML Formatted Message

To send a message with HTML formatting, use HtmlMessage:

[!NOTE] In this example, HTML tags such as <b>, <i>, <a>, and <code> are supported for text formatting.

Send a Photo

Sending with a chat ID

To send a message to a specific chat ID, use the following code:

Notes

License

The MIT License (MIT). Please see License File for more information.


All versions of tebo with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
cakephp/cakephp Version 5.1.*
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 arodu/tebo contains the following files

Loading the files please wait ...