duanguai2781 2019-07-04 15:33
浏览 69

sendPoll中带有'option'数组的电报bot问题

I don't know how to get working the code, probably i have an error writting the 'options' array. Code attached. I use the same elseif for "sendMessage" and works perfect. Thanks!

https://core.telegram.org/bots/api#sendpoll

'options' => array('A','B','C'),

This is not working too

'options' => [ "A", "B", "C" ]

elseif (strpos($text, "/poll") === 0) {

    $parameters2 = array(
        'chat_id' => $chatId,
        'options' => array('A','B','C'),
        'question' => "Select correct one",

    );

    sendButton('sendPoll', $parameters);

}

  • 写回答

1条回答 默认 最新

  • doudeng8691 2019-08-23 09:12
    关注

    You can try this below code

    'options' => json_encode(array('A','B','C')),
    

    in place of

     'options' => array('A','B','C'),
    
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号