HL
$API_URL = "https://api.telegram.org/bot";
$command = "sendMessage";
$token="1070248192:AAH3MZ3x1_8oW9mFeNy1s8bCwgkJ7yxA3Ik";
$info = file_get_contents("php://input");
$jsonData = json_decode($info);
$chat_id = $jsonData->message->chat->id;
$userMessage = $jsonData->message->text;
switch ($userMessage) {
case '/start':
$text = "Саламалейкум брат!";
break;
case '/stop':
$text = "Давай брат, удачи!";
break;
default:
$text = "Не понял че то";
break;
}
$keyboard = [
'inline_keyboard'=> [
['text' => 'Кнопка', 'url' => 'https://google.com']
]
];
$keyboard = json_encode($keyboard);
$params = [
'chat_id' => $chat_id,
'text' => $text,
'reply_markup' => $keyboard
];
file_get_contents($API_URL.$token."/".$command."?".http_build_query($params) );
?>