是否可以使用sendMessage方法将其他变量发送到webhook?
例如设置todo变量:
function processMessage($message) {
// process incoming message
$message_id = $message['message_id'];
$azione = $message['todo'];
$chat_id = $message['chat']['id'];
$firstname = isset($message['chat']['first_name']) ? $message['chat']['first_name'] : "";
$lastname = isset($message['chat']['last_name']) ? $message['chat']['last_name'] : "";
if (isset($message['text'])) {
$text = $message['text'];
if (strpos($text, "/start") === 0) {
apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" => 'Benvenuto '.$firstname.' '.$lastname.' sul BOT di MIMANCHITU, dimmi cosa vuoi fare ['.$azione.']?', 'todo' => "fai qualcosa", 'reply_markup' => array(
'keyboard' => array(array('/consulta', '/guide')),
'one_time_keyboard' => true,
'resize_keyboard' => true)));
}
}
答案 0 :(得分:0)
除了文档中定义的内容之外,您不能发送任何其他变量。