如何为api bot电报发送粗体或斜体信息?
https://api.telegram.org/bottoken/sendMessage?parse_mod=Markdown&chat_id=@testadminch&text=*bold*
输出为:*bold*
但应该是:粗体
答案 0 :(得分:1)
您需要将parse_mode
设置为markdown
$post = array("chat_id" => $id, "text"=> $text, "parse_mode" => "markdown");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.telegram.org/bot" . $GLOBALS["token"] . "/sendMessage");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_exec ($ch);
curl_close ($ch);