Files
web/app/Controllers/BotController.php
2026-01-03 01:12:18 +08:00

40 lines
993 B
PHP

<?php
/*
* Copyright (c) 2025, Антон Аксенов
* This file is part of m3u.su project
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
*/
declare(strict_types=1);
namespace App\Controllers;
use App\Core\Bot;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TelegramBot\Api\Exception;
use TelegramBot\Api\InvalidArgumentException;
/**
* Контроллер методов ТГ бота
*/
class BotController extends BasicController
{
/**
* @throws Exception
* @throws InvalidArgumentException
* @throws \Exception
* @see https://github.com/TelegramBot/Api
* @see https://core.telegram.org/bots/api
* @see https://core.telegram.org/bots/api#markdownv2-style
*/
public function webhook(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
$bot = new Bot($request);
$bot->process();
return $response;
}
}