Answer the question
In order to leave comments, you need to log in
How, when clicking on the Telegram bot button, the user could write to me?
There are such buttons:
switch($message) { // в переменной $message содержится сообщение, которое мы отправляем боту.
case '/start': $bot->sendMessage($user_id, "Привет <i>".$first_name."</i>! Посмотри этот сайт https://www.cbssao.ru//", ); break;
case 'Наши библиотеки': $bot->sendMessage($user_id, "Адреса наших библиотек: http://www.cbssao.ru/libraries.html?ru&list&map", []); break;
case 'Наш Youtube канал': $bot->sendMessage($user_id, $first_name.", подпишись и поставь колокольчик https://www.youtube.com/channel/UCl0xOV9OsaatnS8hNczn30w ", []); break;
case 'Наш Instagram канал': $bot->sendMessage($user_id, $first_name.", подпишись https://www.instagram.com/bibliosever/", []); break;
case 'Контакты библиотеки № 21': $bot->sendMessage($user_id, "http://cbssao.ru/contacts.html?ru", []); break;
case 'Продлить книгу': $bot->sendMessage($user_id, "888", []); break;
case '***': $bot->sendMessage($user_id, "888", []); break;
Answer the question
In order to leave comments, you need to log in
$bot->command('/start', function () use ($bot) {
$bot->say('Старт!', [
[
'Продлить книгу',
]
]);
});
$bot->hear('Продлить книгу', function () use ($bot) {
$bot->setState('book');
$bot->say('Напишите номер книги.');
});
$bot
->state('book', ['Назад'])
->hear(['{default}'], function () use ($bot) {
// проверка и отправка заявки ...
$bot->say('Заявка отправлена!');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question