Bot Discord - Commit completo con todos los cambios

This commit is contained in:
Admin
2026-01-16 20:24:38 -06:00
commit cf8ecfcf64
151 changed files with 28808 additions and 0 deletions

19
set_webhook.php Executable file
View File

@@ -0,0 +1,19 @@
<?php
require_once __DIR__ . '/config/config.php';
$botToken = $_ENV['TELEGRAM_BOT_TOKEN'] ?? '';
$webhookUrl = rtrim($_ENV['APP_URL'], '/') . '/telegram_bot_webhook.php?auth_token=' . urlencode($_ENV['TELEGRAM_WEBHOOK_TOKEN'] ?? '');
if (empty($botToken)) {
die("Error: No se ha configurado el TELEGRAM_BOT_TOKEN en el archivo .env");
}
$apiUrl = "https://api.telegram.org/bot{$botToken}/setWebhook?url=" . urlencode($webhookUrl);
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
header('Content-Type: application/json');
echo $response;