在电报机器人中以 HTML 格式 PHP 发送标题是错误的



我在使用时出错

parse_mode=HTML

sendMessage正在工作,机器人在sendPhoto显示HTML格式链接有错误。

sendMessage

<?php
$txt1="<a href='yahoo.com'>yahoo website</a>";
 $url= "https://api.telegram.org/bot".$token."/sendMessage?parse_mode=HTML&chat_id=".$chat_id."&text=".urlencode($txt1);
    file_get_contents($url);
?>

它确实有效,但sendPhoto

<?php
  $url= "https://api.telegram.org/bot".$token."/sendphoto?parse_mode=HTML&chat_id=".$chat_id."&photo=".$photo."&caption=".urlencode($txt1);
    file_get_contents($url);
?>

它只是将文本显示为标题,没有任何链接。我的代码出了什么问题?请帮助我。 谢谢

很奇怪,我可以在这个有效负载中看到蓝色文本链接。

顺便说一句,您可以尝试内联键盘链接,它比HTML标记更酷:P

最新更新