$group_id\n(برای کپی، روی متن ضربه بزنید و نگه دارید)", "HTML"); } } function sendMessage($token, $chat_id, $text, $parse_mode = null) { $url = "https://api.telegram.org/bot{$token}/sendMessage"; $data = ['chat_id' => $chat_id, 'text' => $text]; if ($parse_mode) $data['parse_mode'] = $parse_mode; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); curl_close($ch); } ?>