I created a php telegram boat. In this case, I will store the user id in the id.txt file.
$message = $update->message;
$text1 = $message->text;
$fadmin = $message->from->id;
$baza = file_get_contents("id.txt");
$saqla2 = "$baza\n$fadmin";
file_put_contents("id.txt", $saqla2);
Then how do I send a message to every registered user? So you need to send a message to all the minorities.
$text2 = str_replace("/xabar","",$text1);
$response = file_get_contents("https://api.telegram.org/bot".API_KEY."/sendMessage?chat_id= //there all user id from $baza // &text=$text2");
you can store
user_ids
in a text file : for examplelist.txt
:now send a message to all users
index.php
: