【发布时间】:2019-12-18 20:47:24
【问题描述】:
我正在使用https://github.com/irazasyed/telegram-bot-sdk 在我的 Laravel 项目中开发一个机器人。我已使用回复键盘标记成功请求联系。问题是我无法进一步处理联系人。我需要有关如何使用我请求的电话号码进行进一步处理的帮助。
这是我现在使用的代码,
public function requestContact()
{
$btn = Keyboard::button([
'text' => 'Share my phone number',
'request_contact' => true
]);
$keyboard = Keyboard::make([
'keyboard' => [[$btn]],
'resize_keyboard' => true,
'one_time_keyboard' => true
]);
Telegram::sendMessage([
'chat_id' => $this->chat_id,
'text' => 'I need your contact to get your ID. Please click the Share Contact button below.',
'reply_markup' => $keyboard
]);ref
}
【问题讨论】:
标签: php laravel telegram-bot php-telegram-bot