telexide_fork/model/
message_entity.rs1pub use super::utils::TextBlock;
2use super::User;
3use serde::{Deserialize, Serialize};
4
5#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
8#[serde(tag = "type")]
9pub enum MessageEntity {
10 #[serde(rename = "mention")]
12 Mention(TextBlock),
13 #[serde(rename = "hashtag")]
15 HashTag(TextBlock),
16 #[serde(rename = "cashtag")]
18 CashTag(TextBlock),
19 #[serde(rename = "bot_command")]
21 BotCommand(TextBlock),
22 #[serde(rename = "url")]
24 Url(TextBlock),
25 #[serde(rename = "email")]
27 Email(TextBlock),
28 #[serde(rename = "phone_number")]
30 PhoneNumber(TextBlock),
31 #[serde(rename = "bold")]
33 Bold(TextBlock),
34 #[serde(rename = "italic")]
36 Italic(TextBlock),
37 #[serde(rename = "underline")]
39 Underline(TextBlock),
40 #[serde(rename = "strikethrough")]
42 StrikeThrough(TextBlock),
43 #[serde(rename = "code")]
45 Code(TextBlock),
46 #[serde(rename = "pre")]
48 Pre(Pre),
49 #[serde(rename = "text_link")]
51 TextLink(TextLink),
52 #[serde(rename = "text_mention")]
54 TextMention(TextMention),
55 #[serde(rename = "custom_emoji")]
57 CustomEmoji(InlineCustomEmoji),
58 #[serde(rename = "spoiler")]
60 Spoiler(TextBlock),
61 #[serde(rename = "blockquote")]
63 Blockquote(TextBlock),
64 #[serde(rename = "expandable_blockquote")]
66 ExpandableBlockquote(TextBlock),
67}
68
69#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
71pub struct Pre {
72 #[serde(flatten)]
74 pub text_block: TextBlock,
75 pub language: Option<String>,
77}
78
79#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
81pub struct TextLink {
82 #[serde(flatten)]
84 pub text_block: TextBlock,
85 pub url: String,
87}
88
89#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
91pub struct TextMention {
92 #[serde(flatten)]
94 pub text_block: TextBlock,
95 pub user: User,
97}
98
99#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
100pub struct InlineCustomEmoji {
101 #[serde(flatten)]
103 pub text_block: TextBlock,
104 pub custom_emoji_id: String,
109}