简体   繁体   English

对KeyboardButton电报机器人使用request_contact

[英]Use request_contact for KeyboardButton telegram Bot

I'm tryng to keep phonenumber of user in a telegram bot with this php script: 我试着通过这个php脚本将用户的电话号码保存在电报机器人中:

apiRequest("sendMessage", array(
    'chat_id' => $chat_id, 
    "text" => 'Ci vuoi inviare il tuo numero di telefono?', 
    'reply_markup' => array(
        'keyboard' => array(
            'text'=>"SHOW PHONE",
            'request_contact'=>true
        ),
        'one_time_keyboard' => true,
        'resize_keyboard' => true
    )
));

But it is not working, what could be the problem? 但它不起作用,可能是什么问题?

Keyboard must be array of arrays: 键盘必须是数组数组:

Update: 更新:

apiRequest("sendMessage", array(
'chat_id' => $chat_id, 
"text" => 'Ci vuoi inviare il tuo numero di telefono?', 
'reply_markup' => array(
        'keyboard' => array(
                           array(
                                array( 
                                  'text'=>"SHOW PHONE",
                                  'request_contact'=>true
                                )
                             )
                      ),

    'one_time_keyboard' => true,
    'resize_keyboard' => true
)
));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM