PHP code example of jungle-bay / telegram-bot-platform

1. Go to this page and download the library: Download jungle-bay/telegram-bot-platform library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jungle-bay / telegram-bot-platform example snippets




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

$tbp = new \TelegramBotPlatform\TelegramBotPlatform(array(
    'token'    => '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11',              // Your token bot.
    'storage'  => $adapter,                                                 // This adapter for Scrapbook library to store user sessions. See the complete adapters: https://github.com/matthiasmullie/scrapbook#adapters
    'payload'  => null,                                                     // This payload will be passed for third parameter to command. (optional)
    'mappings' => array(
        'default'       => \MyBot\Commands\DefaultCmd::class,               // This command will work by default if no command is found or user session. (optional)
        'inline_query'  => \MyBot\Commands\FeedbackInlineQueryCmd::class,   // This command will work with inline queries. (optional)
        'commands'      => array(                                           // This is the list of registered commands for the bot. (optional)
            'help' => \MyBot\Commands\HelpCmd::class,
            'user' => \MyBot\Commands\UserCmd::class
        )
    )
), $request);

$tbp->run();