gptbot.php
$chatId, 'text' => $message, 'reply_to_message_id' => $replyToMessageId, 'parse_mode' => 'markdown' ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apiUrl); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); $response = curl_exec($ch); if (curl_errno($ch)) { error_log('Telegram API cURL error: ' . curl_error($ch)); } curl_close($ch); return $response; } function handleTelegramWebhook($token) { // Get the incoming update from Telegram $update = file_get_contents("php://input"); $updateArray = json_decode($update, true); if (isset($updateArray['message']) && isset($updateArray['message']['chat']['type'])) { $chatType = $updateArray['message']['chat']['ty...