0
sendMessageメソッドで他の変数をwebhookに送ることはできますか? TODO変数を設定する例えばwebhook telegram botにパラメータを渡す方法
:
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)));
}
}
だから、私はユーザーの回答に応じて質問をするだろうか? たとえば、カスタムボタンキーボードで変数を送信することは可能ですか? – DigitalXP
@DigitalXP変数の意味を理解できません。インラインボタンまたはカスタムキーボードを使用して、事前に定義されたコマンドセットをユーザーに提供できます。 – ariaby
私は例を挙げます:私はdbに単語を検索するボットを作っています。私は2つのキーボードオプションから始めますSEARCH INTO A | SEARCH INTO B.ユーザーがINTOで検索をクリックすると、単語を挿入してからDB Aにボット検索を実行しますが、ユーザーがSEARCH INTO Bをクリックすると、ボットはDBへの検索を繰り返します。テキストタイプ!だから私はユーザーがAまたはBをクリックすると、一種のパラメータを渡すだろう! – DigitalXP