Telegram bot api:sendPhoto不渲染html

栏目: Html · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/51582170/telegram-bot-api-sendphoto-do-not-render-html

我正在以这种方式撰写消息

const reply_telegram = {
        "chat_id"               : MIRKO,
        "photo"                 : row.image_url,
        "caption"               : '<b>Wow</b>',
        "parse_mode"            : "HTML",
        "disable_notification"  : true,
}

为了这个问题的目标,请关注

"parse_mode" : "HTML"

我使用sendPhoto而不是经典的sendMessage.

  1. Official docs state that I can use a caption and parse_mode in the sendPhoto method
  2. I am actively using sendMessage with html content, and it’s handled as HTML as I want

简而言之,问题在于:发送消息,发送照片,在照片下打印字幕文本,不打印标签,但标题不是我要求的粗体.

我错过了什么?

如果要发送照片,则只使用2个参数.第一个参数聊天ID和第二个参数照片路径/ id / URL.

https://core.telegram.org/bots/api#sendphoto

如果您想使用更多参数,请尝试一下

你有 Python 示例:

@bot.message_handler(func=lambda message: True)
def echo_message(message):
 cid = message.chat.id
 if "send photo" in message.text.lower():
    bot.send_photo( cid, open( 'files/photo.jpg', 'rb'))

翻译自:https://stackoverflow.com/questions/51582170/telegram-bot-api-sendphoto-do-not-render-html


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

新经济,新规则

新经济,新规则

[美]Kevin Kelly / 刘仲涛 / 译言·东西文库/电子工业出版社 / 2014-7 / CNY 45.00

近年来,互联网持续震动着全世界各个行业以至于整个经济规则……在中国,以小米为代表的各类“互联网思维”轰轰烈烈地颠覆着各个行业……而这一切的一切,凯文凯利早就通过这本小书轻松写定。《新规则,新经济》一书介绍互联网时代,互联网影响下的经济运行的十个新游戏规则。一起来看看 《新经济,新规则》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试