polopolaw's avatar

polopolaw wrote a reply+100 XP

2mos ago

@anatoliyviktorovich for laravel and telgram exists very powerfull package hybridgram/tgbot-laravel Simple echo example

TelegramRouter::group(['for_bot' => 'main'], function (\HybridGram\Core\Routing\TelegramRouteBuilder $builder) {
    $builder->onTextMessage(function (TextMessageData $message) {
        $api = app(TelegramBotApi::class);
        $api->sendMessage($message->getChatId(), "Echo: {$message->text}");
    });
});