Skip to main content

SendSharedWidget

Struct SendSharedWidget 

Source
pub struct SendSharedWidget {
Show 14 fields pub chat_id: Recipient, pub widget_id: WidgetId, pub message_thread_id: Option<ThreadId>, 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 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 again a shared widget created by the bot. 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: Recipient

Unique identifier for the target chat or username of the target supergroup in the format @username

§widget_id: WidgetId

Unique identifier of the shared widget

§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

§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

§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§

Source§

impl SendSharedWidget

Source

pub fn new(chat_id: impl Into<Recipient>, widget_id: WidgetId) -> Self

Trait Implementations§

Source§

impl Clone for SendSharedWidget

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SendSharedWidget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SendSharedWidget

Source§

impl Hash for SendSharedWidget

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SendSharedWidget

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Payload for SendSharedWidget

Source§

const NAME: &'static str = "SendSharedWidget"

Name of the Rust payload (for example, EditMessageTextInline).
Source§

type Output = Message

The return type of a Telegram method. Read more
Source§

const TELEGRAM_METHOD: &'static str = Self::NAME

Case-insensitive Telegram method called on the wire (for example, EditMessageText). Defaults to the payload name.
Source§

fn timeout_hint(&self) -> Option<Duration>

If this payload may take long time to execute (e.g. GetUpdates with big timeout), the minimum timeout that should be used.
Source§

impl Serialize for SendSharedWidget

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SendSharedWidget

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Erasable for T

Source§

const ACK_1_1_0: bool = true

Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Source§

unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>

Unerase this erased pointer. Read more
Source§

fn erase(this: NonNull<Self>) -> NonNull<Erased>

Turn this erasable pointer into an erased pointer. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<P> HasPayload for P
where P: Payload,

Source§

type Payload = P

The type of the payload contained.
Source§

fn payload_mut(&mut self) -> &mut P

Gain mutable access to the underlying payload.
Source§

fn payload_ref(&self) -> &P

Gain immutable access to the underlying payload.
Source§

fn with_payload_mut<F>(self, f: F) -> Self
where Self: Sized, F: FnOnce(&mut Self::Payload),

Update payload with a function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<P> SendSharedWidgetSetters for P
where P: HasPayload<Payload = SendSharedWidget>,

Source§

fn chat_id<T>(self, value: T) -> Self
where T: Into<Recipient>,

Setter for chat_id field.
Source§

fn widget_id(self, value: WidgetId) -> Self

Setter for widget_id field.
Source§

fn message_thread_id(self, value: ThreadId) -> Self

Setter for message_thread_id field.
Source§

fn chat_data<T>(self, value: T) -> Self
where T: Into<String>,

Setter for chat_data field.
Source§

fn caption<T>(self, value: T) -> Self
where T: Into<String>,

Setter for caption field.
Source§

fn parse_mode(self, value: ParseMode) -> Self

Setter for parse_mode field.
Source§

fn caption_entities<T>(self, value: T) -> Self
where T: IntoIterator<Item = MessageEntity>,

Setter for caption_entities field.
Source§

fn show_caption_above_media(self, value: bool) -> Self

Setter for show_caption_above_media field.
Source§

fn disable_notification(self, value: bool) -> Self

Setter for disable_notification field.
Source§

fn protect_content(self, value: bool) -> Self

Setter for protect_content field.
Source§

fn allow_paid_broadcast(self, value: bool) -> Self

Setter for allow_paid_broadcast field.
Source§

fn message_effect_id(self, value: EffectId) -> Self

Setter for message_effect_id field.
Source§

fn reply_parameters(self, value: ReplyParameters) -> Self

Setter for reply_parameters field.
Source§

fn reply_markup<T>(self, value: T) -> Self
where T: Into<ReplyMarkup>,

Setter for reply_markup field.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more