Files
contenedor_ibiza/public/telegram/webhook.php

18 lines
352 B
PHP

<?php
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Services\TelegramBot;
// 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';