jungle-bay/telegram-bot-shell

This package is abandoned and no longer maintained. No replacement package was suggested.

This is mechanism for processing bot commands

This package has no released version yet, and little information is available.


README

Travis CI Scrutinizer CI Codecov SensioLabsInsight

This is platform for the telegram bot, based on pure Telegram Bot API.
Why Shell, I was inspired by the command interpreter used in the operating systems of the *nix family.

Install

The recommended way to install is through Composer:

composer require jungle-bay/telegram-bot-shell

The simplest example of use

<?php

require_once(__DIR__ . '/vendor/autoload.php');

$request = file_get_contents('php://input');                    // Request body. (JSON-serialized Update object)

$tba = new \TelegramBotShell\TelegramBotShell(array(
    'token'    => '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11',  // Your token bot.
    'adapter'  => $adapter,                                     // This adapter for Scrapbook library. See the complete: https://github.com/matthiasmullie/scrapbook#adapters
    'payload'  => $db,                                          // This payload will be passed to command the third parameter. (optional)
    'commands' => array(
        'default'  => \Acme\MyBot\Commands\DefaultCmd::class,   // This command will work by default if no command is found. (optional)
        'mappings' => array(                                    // This is the list of registered commands for the bot. (optional)
            'help' => \Acme\MyBot\Commands\HelpCmd::class,
            'user' => \Acme\MyBot\Commands\UserCmd::class
        )
    )
), $request);

$tba->run();

Docs

See the complete docs in here.

For the convenience of development, you can use Telegram Bot CLI.

License

This bundle is under the MIT license. See the complete license in the file: here.