Первичная реализация, команды /list и /info

This commit is contained in:
2025-06-09 01:11:10 +08:00
parent 6cebf7356c
commit 687ebc3fdc
9 changed files with 476 additions and 35 deletions

13
config/bot.php Normal file
View File

@@ -0,0 +1,13 @@
<?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);
return [
'token' => env('TG_BOT_TOKEN'),
'secret' => env('TG_BOT_SECRET'),
];

View File

@@ -6,16 +6,29 @@
*/
use App\Controllers\ApiController;
use App\Controllers\BasicController;
use App\Controllers\BotController;
use App\Controllers\WebController;
return [
/*
|--------------------------------------------------------------------------
| Web routes
|--------------------------------------------------------------------------
*/
[
'method' => ['GET', 'POST'],
'path' => '/bot/webhook',
'handler' => [BotController::class, 'webhook'],
'name' => 'bot::webhook',
],
[
'method' => ['GET', 'POST'],
'path' => '/bot/update',
'handler' => [BotController::class, 'update'],
'name' => 'bot::update',
],
[
'method' => 'GET',
'path' => '/[page/{page:[0-9]+}]',
@@ -59,12 +72,6 @@ return [
'handler' => [ApiController::class, 'makeQrCode'],
'name' => 'api::makeQrCode',
],
// [
// 'method' => 'GET',
// 'path' => '/{code:[0-9a-zA-Z]+}/logo/{hash:[0-9a-z]+}',
// 'handler' => [ApiController::class, 'logo'],
// 'name' => 'api::getChannelLogo',
// ],
/*
|--------------------------------------------------------------------------
@@ -74,7 +81,7 @@ return [
[
'method' => '*',
'path' => '/{path:.*}',
'path' => '/{path:.+}',
'handler' => [BasicController::class, 'notFound'],
'name' => 'not-found',
],