feat: sync ephemeral bot demo commands

Sync telesrv 172a86e (feat(bot-demo): echo ephemeral group commands).

Skipped telesrv docs changes per public sync rules.
This commit is contained in:
A 2026-07-20 16:44:09 +08:00
parent f49c817def
commit 7de1766941
6 changed files with 258 additions and 4 deletions

View file

@ -17,6 +17,21 @@ In a group with BotFather privacy enabled, send a command such as:
/ping hello from group
```
## Ephemeral echo(Bot API 10.2)
先通过 `setMyCommands` 把 `private` 注册为 `is_ephemeral=true`,然后保持本示例轮询。
在 TDesktop Layer 228 的群组里发送:
```text
/private@你的Bot用户名
```
本示例从 PTB 的 `Message.api_kwargs` 读取 `ephemeral_message_id`,并在 15 秒 action
窗口内用 `receiver_user_id` 与 `reply_parameters.ephemeral_message_id` 回复
`ephemeral echo: ...`。请求失败时不会降级成普通群消息。Alice 应看到两条带
可见性提示的消息:自己发出的命令显示“Only visible to @Bot”,bot 回复显示
“Only visible to you”;Bob 不应看到其中任何一条。
主动发送一条消息并退出:
```powershell