Sending through the bot implemented, is it possible to send directly to the user and how to implement it? Here is the code to send via the bot:

<?php $name = $_POST['name']; $phone = $_POST['phone']; $token = "..."; $chat_id = "-327343925"; $arr = array( 'Имя пользователя: ' => $name, 'Телефон: ' => $phone ); foreach($arr as $key => $value) { $txt .= "<b>".$key."</b> ".$value."%0A"; }; $sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}","r"); ?> 
  • one
    You can send if they started a dialogue with the bot. Otherwise, just the message through the bot is not sent to the user. - Dodik
  • What does it mean to send directly to the user ? - Anatol
  • not through the bot but immediately from the site to the user - Alexander

0