pub struct SendWidget {Show 19 fields
pub chat_id: Recipient,
pub html: String,
pub message_thread_id: Option<ThreadId>,
pub width: Option<u32>,
pub height: Option<u32>,
pub public_data: Option<String>,
pub chat_data: Option<String>,
pub caption: Option<String>,
pub parse_mode: Option<ParseMode>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub show_caption_above_media: Option<bool>,
pub allow_queries: Option<bool>,
pub is_shared: Option<bool>,
pub disable_notification: Option<bool>,
pub protect_content: Option<bool>,
pub allow_paid_broadcast: Option<bool>,
pub message_effect_id: Option<EffectId>,
pub reply_parameters: Option<ReplyParameters>,
pub reply_markup: Option<ReplyMarkup>,
}Expand description
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.
Fields§
§chat_id: RecipientUnique identifier for the target chat or username of the target supergroup in the format @username
html: StringHTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level.
message_thread_id: Option<ThreadId>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
width: Option<u32>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.
height: Option<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.
public_data: Option<String>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.
chat_data: Option<String>Data of the widget, which is specific to the message, 0-1024 bytes
caption: Option<String>Widget caption, 0-1024 characters after entities parsing
parse_mode: Option<ParseMode>Mode for parsing entities in the widget caption. See formatting options for more details.
caption_entities: Option<Vec<MessageEntity>>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
show_caption_above_media: Option<bool>Pass True if the caption must be shown above the widget
allow_queries: Option<bool>Pass True to allow the widget to send queries to the bot
Pass True to create a shared widget, which can be sent again using the method SendSharedWidget
disable_notification: Option<bool>Sends the message silently. Users will receive a notification with no sound.
protect_content: Option<bool>Protects the contents of the sent message from forwarding and saving
allow_paid_broadcast: Option<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.
message_effect_id: Option<EffectId>Unique identifier of the message effect to be added to the message; for private chats only
reply_parameters: Option<ReplyParameters>Description of the message to reply to
reply_markup: Option<ReplyMarkup>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.
Implementations§
Trait Implementations§
Source§impl Clone for SendWidget
impl Clone for SendWidget
Source§impl Debug for SendWidget
impl Debug for SendWidget
impl Eq for SendWidget
Source§impl Hash for SendWidget
impl Hash for SendWidget
Source§impl PartialEq for SendWidget
impl PartialEq for SendWidget
Source§impl Payload for SendWidget
impl Payload for SendWidget
Source§const NAME: &'static str = "SendWidget"
const NAME: &'static str = "SendWidget"
EditMessageTextInline).Source§const TELEGRAM_METHOD: &'static str = Self::NAME
const TELEGRAM_METHOD: &'static str = Self::NAME
EditMessageText). Defaults to the payload name.Source§fn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
GetUpdates with
big timeout), the minimum timeout that should be used.Source§impl Serialize for SendWidget
impl Serialize for SendWidget
impl StructuralPartialEq for SendWidget
Auto Trait Implementations§
impl Forget for SendWidget
impl Freeze for SendWidgetwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<MessageEntity>: Freeze,
PhantomData<RichText>: Freeze,
PhantomData<Vec<InlineKeyboardButton>>: Freeze,
PhantomData<Vec<KeyboardButton>>: Freeze,
impl Move for SendWidget
impl RefUnwindSafe for SendWidget
impl Send for SendWidget
impl Sync for SendWidget
impl Unpin for SendWidget
impl UnsafeUnpin for SendWidgetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MessageEntity>: UnsafeUnpin,
PhantomData<RichText>: UnsafeUnpin,
PhantomData<Vec<InlineKeyboardButton>>: UnsafeUnpin,
PhantomData<Vec<KeyboardButton>>: UnsafeUnpin,
impl UnwindSafe for SendWidgetwhere
RawVecInner: UnwindSafe,
BoxRaw<RichTextKind>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<P> HasPayload for Pwhere
P: Payload,
impl<P> HasPayload for Pwhere
P: Payload,
Source§fn payload_mut(&mut self) -> &mut P
fn payload_mut(&mut self) -> &mut P
Source§fn payload_ref(&self) -> &P
fn payload_ref(&self) -> &P
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<P> SendWidgetSetters for Pwhere
P: HasPayload<Payload = SendWidget>,
impl<P> SendWidgetSetters for Pwhere
P: HasPayload<Payload = SendWidget>,
Source§fn message_thread_id(self, value: ThreadId) -> Self
fn message_thread_id(self, value: ThreadId) -> Self
message_thread_id field.Source§fn public_data<T>(self, value: T) -> Self
fn public_data<T>(self, value: T) -> Self
public_data field.Source§fn parse_mode(self, value: ParseMode) -> Self
fn parse_mode(self, value: ParseMode) -> Self
parse_mode field.Source§fn caption_entities<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = MessageEntity>,
fn caption_entities<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = MessageEntity>,
caption_entities field.Source§fn show_caption_above_media(self, value: bool) -> Self
fn show_caption_above_media(self, value: bool) -> Self
show_caption_above_media field.Source§fn allow_queries(self, value: bool) -> Self
fn allow_queries(self, value: bool) -> Self
allow_queries field.is_shared field.Source§fn disable_notification(self, value: bool) -> Self
fn disable_notification(self, value: bool) -> Self
disable_notification field.Source§fn protect_content(self, value: bool) -> Self
fn protect_content(self, value: bool) -> Self
protect_content field.Source§fn allow_paid_broadcast(self, value: bool) -> Self
fn allow_paid_broadcast(self, value: bool) -> Self
allow_paid_broadcast field.Source§fn message_effect_id(self, value: EffectId) -> Self
fn message_effect_id(self, value: EffectId) -> Self
message_effect_id field.Source§fn reply_parameters(self, value: ReplyParameters) -> Self
fn reply_parameters(self, value: ReplyParameters) -> Self
reply_parameters field.Source§fn reply_markup<T>(self, value: T) -> Selfwhere
T: Into<ReplyMarkup>,
fn reply_markup<T>(self, value: T) -> Selfwhere
T: Into<ReplyMarkup>,
reply_markup field.