2017-07-25 39 views
-2

電報有一個機器人,它的名字是@like。您可以使用該機器人創建投票。php如何創建共享消息的內聯按鈕

enter image description here

我的問題是分享按鈕。如何分享,創建投票消息,以便其他用戶可以喜歡或不喜歡它?

@like bot給我吹響分享的字符串。我如何在PHP中實現這一目標?

enter image description here

回答

0

終於讓我找到如何做到這一點。我爲laravel使用了irazasyed/telegram-bot-sdk庫。

所以對於股票的消息,我們可以使用:switch_inline_query

$inlineLayout[][] = Keyboard::inlineButton(['text' => 'forward me to groups', 'switch_inline_query' => 'post_'.$post->id]); 
      $keyboard = $this->telegram->replyKeyboardMarkup([ 
       'inline_keyboard' => $inlineLayout, 

      ]); 

$response = $this->telegram->sendMessage() 
          ->replyMarkup($keyboard) 
          ->chatId($chatid) 
          ->text("sample Text") 
          ->getResult();