<?php

include('TelegramBot/Api/BotApi.php');
include('TelegramBot/Api/Exception.php');
include('TelegramBot/Api/InvalidArgumentException.php');
include('TelegramBot/Api/BaseType.php');

// Inicializar bot con el token
define(TOKEN, '13724466:AAETkFQjiQGlLeJMchaZr2Kfjih3V3h6uua');
$bot = new \TelegramBot\Api\BotApi(TOKEN);

// Activar Webhook
define(URL_BOT, 'https://nuestroserver.com/telegrambot.php');
$result = $bot->setWebhook(URL_BOT);

if ($result)
        echo 'Webhook registrado correctamente';
else
        echo 'Error al registrar el Webhook';
