rezident/wise-telegram-bot

dev-master 2023-05-05 09:53 UTC

This package is auto-updated.

Last update: 2024-09-21 18:15:34 UTC


README

Creating the bot

To create a new bot object, you need a token. This token can be obtained with a special bot - @BotFather. Creating a bot object:

$bot = new \Rezident\WiseTelegramBot\Bot('special token');

Processing updates

The bot can receive the update in two ways: by requesting it itself (using the getUpdates method) or by receiving it as an associative array (using webhooks).

Associative array

For the bot to process the update as an associative array, it must be passed to the handleUpdate method:

$update = json_decode($body);

$bot = new \Rezident\WiseTelegramBot\Bot('special token');
$bot->handleUpdate($update);