teloxide/src/payloads/send_message.rs

45 lines
2.3 KiB
Rust
Raw Normal View History

// This file is auto generated by `cg` <https://github.com/teloxide/cg> (24572cd + local changes).
2020-11-11 20:41:44 +01:00
// **DO NOT EDIT THIS FILE**,
// edit `cg` instead.
use serde::Serialize;
2020-09-28 23:45:04 +02:00
2021-03-14 20:44:33 +01:00
use crate::types::{ChatId, Message, MessageEntity, ParseMode, ReplyMarkup};
2020-09-28 23:45:04 +02:00
2020-10-23 20:32:57 +02:00
impl_payload! {
2020-11-11 20:41:44 +01:00
/// Use this method to send text messages. On success, the sent [`Message`] is returned.
2020-09-28 23:45:04 +02:00
///
2020-10-23 20:32:57 +02:00
/// [`Message`]: crate::types::Message
2020-11-11 20:41:44 +01:00
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
2020-10-23 20:32:57 +02:00
pub SendMessage (SendMessageSetters) => Message {
required {
2020-11-11 20:41:44 +01:00
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
2020-10-23 20:32:57 +02:00
pub chat_id: ChatId [into],
2020-11-11 20:41:44 +01:00
/// Text of the message to be sent, 1-4096 characters after entities parsing
2020-10-23 20:32:57 +02:00
pub text: String [into],
}
optional {
2020-11-11 20:41:44 +01:00
/// Mode for parsing entities in the message text. See [formatting options] for more details.
2020-10-23 20:32:57 +02:00
///
2020-11-11 20:41:44 +01:00
/// [formatting options]: https://core.telegram.org/bots/api#formatting-options
2020-10-23 20:32:57 +02:00
pub parse_mode: ParseMode,
2021-03-14 20:44:33 +01:00
/// List of special entities that appear in the message text, which can be specified instead of _parse\_mode_
pub entities: Vec<MessageEntity> [collect],
2020-10-23 20:32:57 +02:00
/// Disables link previews for links in this message
pub disable_web_page_preview: bool,
2020-11-11 20:41:44 +01:00
/// Sends the message [silently]. Users will receive a notification with no sound.
///
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
2020-10-23 20:32:57 +02:00
pub disable_notification: bool,
2020-11-11 20:41:44 +01:00
/// If the message is a reply, ID of the original message
2020-11-16 10:58:55 +01:00
pub reply_to_message_id: i32,
2021-03-14 20:44:33 +01:00
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
pub allow_sending_without_reply: bool,
2020-11-11 20:41:44 +01:00
/// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove reply keyboard or to force a reply from the user.
2020-10-23 20:32:57 +02:00
///
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
2021-01-07 22:44:19 +01:00
/// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
2020-11-11 20:41:44 +01:00
pub reply_markup: ReplyMarkup [into],
2020-09-28 23:45:04 +02:00
}
}
}