diff --git a/settings/telegram_link.php b/settings/telegram_link.php new file mode 100644 index 0000000..01532ad --- /dev/null +++ b/settings/telegram_link.php @@ -0,0 +1,41 @@ + 0) { + exit(); + header("location: /"); + }*/ + +mysqli_query($conx, "UPDATE accounts SET telegram_id='$post_teleid' WHERE uid='$u_uid'"); +mysqli_query($conx, "UPDATE accounts SET telegram_verf='no' WHERE uid='$u_uid'"); +$bot_id = "use ur own telegram bot id if u want to use this"; + +# Note: you want to change the offset based on the last update_id you received +$url = 'https://api.telegram.org/bot' . $bot_id . '/getUpdates?offset=0'; +$result = file_get_contents($url); +$result = json_decode($result, true); + +foreach ($result['result'] as $message) { + //var_dump($message); +} +# The chat_id variable will be provided in the getUpdates result +$botmsg = "$u_username requested to link your Telegram ID with their Misdew account. Type '/verify' to accept and complete the link."; +$url = 'https://api.telegram.org/bot' . $bot_id . '/sendMessage?text='. $botmsg .'&chat_id=' . $post_teleid; +$result = file_get_contents($url); +$result = json_decode($result, true); + +//var_dump($result['result']); +} +else { + exit(); +} +?>