我正在使用电报机器人从python脚本发送信息
我向电报机器人发送信息的功能是:
def telegram_bot_sendtext(bot_message):
bot_token = 'token'
bot_chatID = 'id'
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message
response = requests.get(send_text)
return response.json()
其中一个信息是一个名为“URL”的变量,它包含URL,例如,这一个:https://www.sezane.com/fr/product/collection-printemps-all-0804/robe-will?cou_Id=859
我有两个问题:
1)} 禁用此选项。(html解析模式中没有
markdown
parseMode需要有效的标记语法,我猜示例url中的_
会启动一个从未关闭的Markdown italic text,电报返回一个错误,消息将不会发送。使用^{_
元素)2)
markDown
和HTML
解析模式都提供了向消息添加超链接的选项HTML
降价
有关更多信息,请查看那里的documentation
相关问题 更多 >
编程相关推荐