spherepack/bot-creator

You can easily create your own bot and work with it

1.1.2 2023-04-19 13:54 UTC

This package is auto-updated.

Last update: 2024-04-19 16:25:17 UTC


README

You can easily create your own bot and work with it

Installation

composer require spherepack/bot-creator

Usage

$bot = new TelegramBot(TOKEN)

Example

$bot = new TelegramBot(TG_TOKEN);
if (!$bot->isAnswer()){
    $bot->setUserId(TG_TEST_USER_ID);
    $bot->setMessage('регистрация');
}

$command = new BotRouter(new TelegramCommands());
$message = $command->call($bot->getMessage(), $bot->getUserId());

$bot->setMessage($message);
$bot->setKeyboard(['Регистрация']);
echo json_encode($bot->send(), JSON_UNESCAPED_UNICODE);