1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Generated by `codegen_payloads`, do not edit by hand.
use serde::Serialize;
use crate::types::{
EffectId, Message, MessageEntity, ParseMode, Recipient, ReplyMarkup, ReplyParameters, ThreadId,
};
impl_payload! {
/// Use this method to send a message with an [HTML widget]. Currently, in the production environment, widgets can be sent only to private chats, and sent widgets automatically have protected content and therefore can't be forwarded. On success, the sent [`Message`] is returned.
///
/// [HTML widget]: https://core.telegram.org/bots/widgets
/// [`Message`]: crate::types::Message
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub SendWidget (SendWidgetSetters) => Message {
required {
/// Unique identifier for the target chat or username of the target supergroup in the format `@username`
pub chat_id: Recipient [into],
/// HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level.
pub html: String [into],
}
optional {
/// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
pub message_thread_id: ThreadId,
/// Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble.
pub width: u32,
/// Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600.
pub height: u32,
/// Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data.
pub public_data: String [into],
/// Data of the widget, which is specific to the message, 0-1024 bytes
pub chat_data: String [into],
/// Widget caption, 0-1024 characters after entities parsing
pub caption: String [into],
/// Mode for parsing entities in the widget caption. See [formatting options] for more details.
///
/// [formatting options]: https://core.telegram.org/bots/api#formatting-options
pub parse_mode: ParseMode,
/// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*
pub caption_entities: Vec<MessageEntity> [collect],
/// Pass *True* if the caption must be shown above the widget
pub show_caption_above_media: bool,
/// Pass *True* to allow the widget to send queries to the bot
pub allow_queries: bool,
/// Pass *True* to create a shared widget, which can be sent again using the method [`SendSharedWidget`]
///
/// [`SendSharedWidget`]: crate::payloads::SendSharedWidget
pub is_shared: bool,
/// Sends the message [silently]. Users will receive a notification with no sound.
///
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
pub disable_notification: bool,
/// Protects the contents of the sent message from forwarding and saving
pub protect_content: bool,
/// Pass *True* to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
///
/// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
pub allow_paid_broadcast: bool,
/// Unique identifier of the message effect to be added to the message; for private chats only
pub message_effect_id: EffectId,
/// Description of the message to reply to
pub reply_parameters: ReplyParameters,
/// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user.
///
/// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
/// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
pub reply_markup: ReplyMarkup [into],
}
}
}