【问题标题】:How to open telegram web application by button from channel (not private chat)?如何通过频道(不是私人聊天)的按钮打开电报网络应用程序?
【发布时间】:2022-12-07 07:55:04
【问题描述】:

有没有办法通过单击按钮从频道打开 Telegram 中的 Web 应用程序?也就是说,算法是什么?

将机器人添加到频道 机器人发送带有按钮的消息 用户单击按钮,应用程序在 Telegram 中打开

问题:没有发送带有右键的消息。错误:

 [error_code] => 400
 [description] => Bad Request: BUTTON_TYPE_INVALID

我的代码:

   $telegram = new Telegram($bot_api_key, $bot_username);

      $keyboard = [
          "inline_keyboard" => [
              [
                   [
                     'text' => 'Open App',
                     'web_app' => ['url' => 'https://test.com/bot.php'],
                   ]
              ]
          ]
      ];
      $result = Request::sendMessage([
        'chat_id' => $chat_id,
        'parse_mode' => 'markdown',
        'text'    => 'Test message',
        'reply_markup' => $keyboard
      ]);

【问题讨论】:

    标签: php api bots telegram


    【解决方案1】:

    我相信这不适用于私人聊天中机器人发送的消息,不适用于频道或群组

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-13
      • 2021-07-05
      • 1970-01-01
      • 2012-08-28
      • 1970-01-01
      • 2016-06-28
      • 2023-03-24
      • 1970-01-01
      相关资源
      最近更新 更多