在电报机器人中以html格式发送标题错误

时间:2018-03-01 00:14:23

标签: php bots telegram telegram-bot

使用

时出错了
  

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);


?>
&#13;
&#13;
&#13;

它适用于sendPhoto

&#13;
&#13;
<?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);



?>
&#13;
&#13;
&#13;

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

1 个答案:

答案 0 :(得分:0)

很奇怪,我可以在this payload看到蓝色文字链接。

顺便说一句,你可以试试inline keyboard link,它比HTML标记更酷:P