morny-book/inline/raw-text.md

50 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# RAW TEXT
一个内联查询,你输入什么,它就输出什么。
你输入`什么`。
它就输出
![“什么” sent by @morny](./raw-text-example.png)
## 一些已知的限制
**RAW TEXT 无法通过 morny 发送图片或者文件等媒体。**
因为 Telegram Bot API 的限制,在发送媒体文件的情况下无法进行内联查询。其实 Bot API 的内联查询字段也没有设计有媒体输入的字段。内联查询只能输入纯文本。
**RAW TEXT 无法通过 morny 发送贴纸。**
和上面的同理。
你甚至不能为一个贴纸消息附加任何文本。
不过我们预计会解决这个问题。这可能通过一个其它的内联查询来实现:可以通过向内联查询输入一个 sticker id 来发送贴纸。
**RAW TEXT 无法发送富文本。**
**RAW TEXT 输入任何的富文本格式都会丢失格式信息。**
因为 Telegram Bot API 的限制。
> 内联查询只能输入纯文本。
Telegram Bot API 中的内联查询只能得到用户输入的纯文本格式的输入信息。任何格式信息在 Telegram 的服务器已经被丢弃。显然无论如何,我们也无法获取得到上游已经丢弃掉的信息。
由于另外一些 API 问题,由用户以纯文本格式输入一些 markdown 文本或是 HTML 文本也十分不稳定。<small>这个在 [*msg 工具](../executor/admin-msg-send) 上面确实[有实现](../executor/admin-msg-send#使用富文本)。在那个情况下实现这个功能十分的简单稳定。但是在内联查询的情况下却变得大不一样。</small>
因此RAW TEXT 无法实现富文本发送。
---
## technic infomation
<table>
<thead><tr><th colspan=2>inline query node info</th></tr></thead>
<tr><td align=right><b>title</b></td><td>Raw Text</td></tr>
<tr><td align=right><b>id</b></td><td><code>[morny/r/text]</code></td></tr>
<tr><td align=right><b>cache</b></td><td><u>default<small><code>300</code></small></u></td></tr>
<tr><td align=right><b>is_personal</b></td><td><u>default<small><code>false</code></small></u></td></tr>
</table>