22 lines
417 B
PHP
22 lines
417 B
PHP
<?php
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Services\TelegramBot;
|
|
use App\Config\Env;
|
|
|
|
// Cargar variables de entorno
|
|
Env::load();
|
|
|
|
// Recibir solicitud webhook
|
|
$input = file_get_contents('php://input');
|
|
$data = json_decode($input, true);
|
|
|
|
if ($data) {
|
|
$bot = new TelegramBot();
|
|
$bot->processWebhook($data);
|
|
}
|
|
|
|
// Retornar 200 OK siempre a Telegram
|
|
http_response_code(200);
|
|
echo 'OK';
|