Posts

Showing posts from November, 2023

Telegram bot webhook setting

Get Web hook info https://api.telegram.org/bot <bot_token>/getWebhookInfo Set webhook " https://api.telegram.org/bot123456:ABC-DEF1x57W2v1u123ew11/setWebhook?url=https://www.example.com " Simple bot " ////////////////////////////////////////////////////////////// <?php // Set your Telegram bot token and chat IDs $token = "6362906582:AS_J3JurrZPqpGRcx_kGXinYQjg"; $chatIDs = ["1306957765", "1175802040"]; // Add more chat IDs as needed // Function to send a message to Telegram function sendMessage($message, $chatID) {     global $token;     $url = "https://api.telegram.org/bot$token/sendMessage?chat_id=$chatID&text=" . urlencode($message);     file_get_contents($url); } // Database credentials $dbHost = "localhost"; $dbUser = ""; $dbPass = ""; $dbName = ""; // Set the interval in seconds // Read the last checked ID from a file $lastCheckedIDFile = "last_checked_id.txt"; if...