我正在尝试发送带有电话号码的消息作为链接。有没有办法来实现呢?我正在使用Laravel Telegram Bot API
public function start( $telegram, $chatid ) {
$keyboard = [
['Continue'],
];
$reply_markup = Telegram::replyKeyboardMarkup([
'keyboard' => $keyboard,
'resize_keyboard' => true,
'one_time_keyboard' => true
]);
$text = "<b>¡Hola!</b> " . config('constants.emojis.waving-hand') .
" Hey I'm Bot. " . config('constants.emojis.hug-face') .
"\nPlease chose some option" .
config('constants.emojis.glass') . "\nOr contact us at <a href='tel:018099999999'>HEREÍ</a> to talk with an specialist.";
$this->sendMessage( $telegram, $chatid, $text, $reply_markup );
}
此处还有我的发送消息功能
public function sendMessage( $telegram, $chatid, $text, $reply_markup ) {
if ( !is_null( $reply_markup ) ) {
$response = $telegram->sendMessage([
'chat_id' => $chatid,
'text' => $text,
'parse_mode' => 'HTML',
'reply_markup' => $reply_markup
]);
} else {
$response = $telegram->sendMessage([
'chat_id' => $chatid,
'text' => $text,
'parse_mode' => 'HTML',
]);
}
}
提前致谢。
答案 0 :(得分:0)
您可以将电话号码与settings.py
和plus
代码一起使用:
<强> 98 强> 9123456789
如果您使用该格式,电报会自动链接该号码!