A
A
Alexey Tutubalin2018-06-21 09:25:02
PHP
Alexey Tutubalin, 2018-06-21 09:25:02

How to make a closed Telegram bot?

Hello, I want to attach a telegram bot only for administrators to the site, so that when trying to enter the site with incorrect data, the bot would write a message to the site administrators, the message itself is sent like this (everything works):

$token = "хххххххххххххххххх";
$chat_id = "ххххххх";
$message .= "Неудачная попытка авторизации на сайте с использованием неверного пароля.\r\n Дата: {$_TIME}\r\n IP: {$_IP}\r\n Логин: '".$db->safesql($member_id['name'])."' ";
$sendToTelegram = file_get_contents("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$message}&parse_mode=HTML&disable_web_page_preview=false&disable_notification=false");

How to make the bot write to certain people (5-7 people) and no one else saw it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question