Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
771 views
in Technique[技术] by (71.8m points)

html - Use Markdown code block in Telegram PHP API

I want to send code block with telegram bot in PHP language.
I already use "`", but I did not get any result.

I use HTML parse_mode.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

there are 2 formatting options: https://core.telegram.org/bots/api#formatting-options

also see parse_mode in sendMessage: https://core.telegram.org/bots/api#sendmessage

you should set it in this param and then use concurrent formatting (markdown in your case)

UPD if you use html mode, use <code> for inline block and <pre> for multiline


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...