You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src_docs/content/doc/filters/telegrambot.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,16 @@ Based on [go-telegram/bot](https://github.com/go-telegram/bot).
30
30
|**media_type**|_STRING_|`document`|`send_media`: one of `photo`, `document`, `video`, `audio`, `voice`, `animation`, `sticker`. Templated. |
31
31
|**reply_markup**|_STRING_| empty | Raw Bot API JSON. Variant auto-detected by top-level key: `inline_keyboard` → InlineKeyboardMarkup, `keyboard` → ReplyKeyboardMarkup, `remove_keyboard` → ReplyKeyboardRemove, `force_reply` → ForceReply. Templated, then parsed. |
32
32
33
-
All string parameters support [templates](../../rules/templates/).
33
+
All string parameters support [templates](en/doc/rules/templates/).
34
+
35
+
In addition to the standard sprig functions, two extra template helpers are exposed for safe text rendering:
36
+
37
+
| Function | Purpose |
38
+
|---|---|
39
+
|`htmlEscape`| Escapes `<`, `>`, `&`, `"` so user-supplied text can be safely embedded with `parse_mode="HTML"` (the default). Required when the rendered text contains `<`, otherwise Telegram parses it as an HTML tag and rejects the message. |
40
+
|`mdv2Escape`| Escapes the MarkdownV2 reserved set (`` _*[]()~`>#+-=|{}.! ``) for use with `parse_mode="MarkdownV2"`. |
0 commit comments