From 76bd14b814bd5e81f3d272ab5edf2496b1c50aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=8B=D1=80=D1=86=D0=B5=D0=B2=20=D0=92=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=20=D0=98=D0=B3=D0=BE=D1=80=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sat, 15 Jun 2024 15:06:16 +0300 Subject: [PATCH] Add the docs about the ability to specify custom emoji entities using HTML and MarkdownV2 formatting --- crates/teloxide-core/src/types/parse_mode.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/teloxide-core/src/types/parse_mode.rs b/crates/teloxide-core/src/types/parse_mode.rs index ba79c760..0edc69eb 100644 --- a/crates/teloxide-core/src/types/parse_mode.rs +++ b/crates/teloxide-core/src/types/parse_mode.rs @@ -47,6 +47,7 @@ use serde::{Deserialize, Serialize}; /// *bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold* /// [inline URL](http://www.example.com/) /// [inline mention of a user](tg://user?id=123456789) +/// ![👍](tg://emoji?id=5368324170671202286) /// `inline fixed-width code` /// ``` /// pre-formatted fixed-width code block @@ -72,6 +73,12 @@ use serde::{Deserialize, Serialize}; /// `underline` entity, so instead of `___italic underline___` use `___italic /// underline_\r__`, where `\r` is a character with code `13`, which will be /// ignored. +/// - A valid emoji must be provided as an alternative value for the custom +/// emoji. The emoji will be shown instead of the custom emoji in places where +/// a custom emoji cannot be displayed (e.g., system notifications) or if the +/// message is forwarded by a non-premium user. It is recommended to use the +/// emoji from the emoji field of the custom emoji [sticker](https://core.telegram.org/bots/api#sticker). +/// - Custom emoji entities can only be used by bots that purchased additional usernames on [Fragment](https://fragment.com/). /// /// ## HTML style /// @@ -86,6 +93,7 @@ use serde::{Deserialize, Serialize}; /// bold italic bold italic bold strikethrough italic bold strikethrough spoiler underline italic bold bold /// inline URL /// inline mention of a user +/// 👍 /// inline fixed-width code ///
pre-formatted fixed-width code block
#[doc = "
pre-formatted fixed-width code block written in the \
@@ -104,6 +112,8 @@ use serde::{Deserialize, Serialize};
 /// - Use nested `pre` and `code` tags, to define programming language for `pre`
 ///   entity.
 /// - Programming language can't be specified for standalone `code` tags.
+/// - A valid emoji must be used as the content of the `tg-emoji` tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji [sticker](https://core.telegram.org/bots/api#sticker).
+/// - Custom emoji entities can only be used by bots that purchased additional usernames on [Fragment](https://fragment.com/).
 ///
 /// ## Markdown style
 ///