apid_telegram_bot/calls/message/
send_message.rs

1use apid::Call;
2use serde::{Deserialize, Serialize};
3
4use crate::types::{ChatId, Message};
5
6/// Use this method to send text messages. On success, the sent [`Message`] is returned.
7#[derive(Debug, PartialEq, Serialize, Deserialize)]
8pub struct SendMessage {
9    /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
10    pub chat_id: ChatId,
11
12    /// Text of the message to be sent, 1-4096 characters after entities parsing
13    pub text: String,
14
15    /// Mode for parsing entities in the message text.
16    /// See formatting options for more details.
17    #[serde(flatten, skip_serializing_if = "Option::is_none")]
18    pub parse_mode: Option<ParseMode>,
19}
20
21#[derive(Debug, PartialEq, Serialize, Deserialize)]
22#[serde(rename_all = "snake_case", tag = "parse_mode")]
23pub enum ParseMode {}
24
25impl Call for SendMessage {
26    type Response = Message;
27}