Created
February 19, 2018 21:16
-
-
Save salvatorecordiano/d36428410a055e3007010acdaee8dc90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: application/json'); | |
$content = file_get_contents('php://input'); | |
$update = json_decode($content, true); | |
if (!$update) { | |
exit; | |
} | |
$chatId = $update['message']['chat']['id'] ?? null; | |
$text = $update['message']['text'] ?? 'Inserire un testo valido'; | |
$parameters = []; | |
$parameters['chat_id'] = $chatId; | |
$parameters['text'] = $text; | |
$parameters['method'] = 'sendMessage'; | |
$parameters['reply_markup'] = [ | |
'keyboard' => [ | |
['Spaghetti Cacio e pepe', 'Spaghetti alla Carbonara'], | |
['Pappardelle al Ragù', 'Pappardelle ai Funghi'], | |
['Strozzapreti al Pesto', 'Fusilli al pomodoro'], | |
['Test 1', 'Test 2', 'Test 3'], | |
['Nuova comanda [010]', 'Precedente comanda [009]'] | |
], | |
'one_time_keyboard' => true, | |
'resize_keyboard' => true | |
]; | |
echo json_encode($parameters); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment