文章 "如何采用 MQL5 创建用于 Telegram 的 bots" - 页 54

 
Maksym Mudrakov #:

我试过在邮件正文中写入"<br/>",也试过用角括弧代替,得到"&lt;br/&gt;",但都不起作用。

我现在不在 PS 上,我记得我下载了旧版本的 web telegram,看到了浏览器栏中的内容。
 
Maksym Mudrakov #:

这对我没用。

这是我唯一能用的方法,没有其他转调方法。

  string text="MQLInfoString(MQL_PROGRAM_NAME)+"%0A"+
              "(string)AccountInfoInteger(ACCOUNT_LOGIN)+"%0A"+
              txt;
Init("POST","/bot"+Token+"/sendMessage?chat_id="+chat_ID,Head,"&parse_mode=HTML&text="+text);
 

这对我很有用。

"<u>underlined</u>\n"
"<b>bold</b>\n"
"<i>italic</i>\n"
"<s>strikethrough</s>\n"
"<a href=\"http://www.example.com/\">URL</a>\n"
"<code>inline fixed-width code</code>\n"
"<pre>pre-formatted monospace</pre></font>\n"
"<pre><code class=\"language-MQL5\">pre-formatted fixed-width code block written in the MQL5 programming language</code></pre>\n"
"<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>"
"<tg-spoiler>spoiler</tg-spoiler>\n"
 
Edgar Akhmadeev #:

这对我很有用。

截图

 

您能告诉我如何从 telegram 的链接中移除网站预览吗?是否可以在发送信息 时禁用此功能?

 
Fokus24 发送信息 时禁用此功能?

我不这么认为。我在旧的 API 中没有找到这个功能。

 
Fokus24 发送信息 时禁用此功能?

请查看https://core.telegram.org/bots/api#sendmessage 中的link_preview_options

Telegram Bot API
  • core.telegram.org
The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. To learn how to create…
 
AmirKian2341 Telegram 机器人 发送的消息。

请帮助我解决任何您知道的问题。

早上好!您找到问题的解决方案了吗?因为我也有同样的问题。谢谢

 
下午好。在向聊天室发送照片时,我收到一个错误信息--错误请求:指定了错误的 HTTP URL。您能告诉我问题出在哪里吗?
 
SendMessage 函数正常工作,但 SendPhoto 函数却出现错误 Bad Request: Wrong HTTP URL specified(错误的 HTTP URL 指定)