Первичная реализация, команды /list и /info
This commit is contained in:
38
app/Controllers/BotController.php
Normal file
38
app/Controllers/BotController.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2025, Антон Аксенов
|
||||
* This file is part of iptv.axenov.dev web interface
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user