spherepack/bot-creator

You can easily create your own bot and work with it

Installs: 441

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/spherepack/bot-creator

1.2.2 2024-06-10 17:47 UTC

This package is auto-updated.

Last update: 2026-01-10 21:06:48 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);