Answer the question
In order to leave comments, you need to log in
Logic, Telegram bot algorithm. How?
Hello!
There was a need to make a shutdown and shutdown in the bot.
When OFF only the Admin sees everything, the rest is some kind of text, they say come later.
Implemented like this:
while (true) {
if ($bot->isAdmin($chat_id) == true) {
break;
}else{
# ВКЛ- и ВЫКЛючение БОТа
if ($bot->getSettings()['on_off'] == 'off') {
$reply = "Какой то текст...";
$reply_markup = $telegram->replyKeyboardHide(['hide_keyboard' => true,]);
$telegram->sendMessage([ 'chat_id' => $chat_id, 'text' => $reply, 'reply_markup' => $reply_markup, ]);
return;
}
break;
}
}
switch ($text) {
case '/start':
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question