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

问题描述

我正在尝试使用带有此网址的 Telegram API 发送文本,例如“Hello # World”:

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

完整网址:

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

enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...