【问题标题】:send picture after user press inline button - telegram bot in php用户按下内联按钮后发送图片 - php中的电报机器人
【发布时间】:2017-04-10 19:27:19
【问题描述】:

我知道如何发送照片或文件并获取回调数据并回答它

现在如何在用户按下内联按钮时发送照片?

这是我的代码

$option = array( 
    array(
        $telegram->buildInlineKeyboardButton($text="One","",$callback_data="One",""),
        $telegram->buildInlineKeyboardButton($text="Two","",$callback_data="Two","")
    )
);

$keyb = $telegram->buildInlineKeyBoard($option);

$content = array(
    'chat_id' => $chat_id,
    'reply_markup' => $keyb,
    'text' => "One Or Two ?"
);

$telegram->sendMessage($content);

感谢任何答案

【问题讨论】:

    标签: php bots telegram


    【解决方案1】:

    您应该设置一个查询回调处理程序。 回调具有按钮回调的数据(您设置,而不是标题);

    你必须在回调字符串之间切换大小写来处理发生的事情,

    然后通过api发送照片。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-10
      • 2020-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-27
      • 2020-07-09
      • 1970-01-01
      相关资源
      最近更新 更多