如何发送 '#' 与 Telegram bot API 聊天?

How to send '#' to chat with Telegram bot API?

我正在尝试使用 Telegram API 发送一条文本,例如“Hello # World” url:

https://api.telegram.org/bot'token'/sendMessage?chat_id='chatid'&text=Hello+#+World

但是我刚收到Hello

我也试过这样编码:

https://api.telegram.org/bot'token'/sendMessage?chat_id='chatid'&text=Hello+%23+World

但我刚收到 Hello %23 World

接收 Hello # World 的任何解决方案?谢谢 :D

你没有url-encode字符串正确,应该是

Hello%20%23%20World

改为关闭

Hello+%23+World

完整的url:

https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=<CHAT-ID>&text=Hello%20%23%20World