Skip to content

Instantly share code, notes, and snippets.

@salvatorecordiano
Created February 19, 2018 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salvatorecordiano/d36428410a055e3007010acdaee8dc90 to your computer and use it in GitHub Desktop.
Save salvatorecordiano/d36428410a055e3007010acdaee8dc90 to your computer and use it in GitHub Desktop.
<?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