Enum MessageData

Source
pub enum MessageData {
Show 63 variants Animation(Animation), AutoDeleteTimerChanged(MessageDataAutoDeleteTimer), BoostAdded(Integer), ChannelChatCreated, ChatBackgroundSet(ChatBackground), ChatShared(MessageDataChatShared), Checklist(Checklist), ChecklistTasksAdded(ChecklistTasksAdded), ChecklistTasksDone(ChecklistTasksDone), ConnectedWebsite(String), Contact(Contact), DeleteChatPhoto, Dice(Dice), DirectMessagePriceChanged(MessageDataDirectMessagePriceChanged), ForumTopicClosed, ForumTopicCreated(MessageDataForumTopicCreated), ForumTopicEdited(MessageDataForumTopicEdited), ForumTopicReopened, Game(Game), Gift(GiftInfo), GeneralForumTopicHidden, GeneralForumTopicUnhidden, Giveaway(Giveaway), GiveawayCreated(GiveawayCreated), GiveawayCompleted(GiveawayCompleted), GiveawayWinners(GiveawayWinners), GroupChatCreated, Invoice(Invoice), LeftChatMember(User), Location(Location), MigrateFromChatId(Integer), MigrateToChatId(Integer), NewChatMembers(Vec<User>), NewChatPhoto(Vec<PhotoSize>), NewChatTitle(String), PaidMedia(PaidMediaInfo), PaidMessagePriceChanged(MessageDataPaidMessagePriceChanged), PassportData(PassportData), PinnedMessage(MaybeInaccessibleMessage), Poll(Poll), ProximityAlertTriggered(MessageDataProximityAlert), RefundedPayment(RefundedPayment), Sticker(Sticker), Story(Story), SuccessfulPayment(SuccessfulPayment), SupergroupChatCreated, UniqueGift(UniqueGiftInfo), UsersShared(MessageDataUsersShared), Venue(Venue), VideoNote(VideoNote), VideoChatEnded(MessageDataVideoChatEnded), VideoChatParticipantsInvited(MessageDataVideoChatParticipantsInvited), VideoChatScheduled(MessageDataVideoChatScheduled), VideoChatStarted, WebAppData(WebAppData), WriteAccessAllowed(MessageDataWriteAccess), Audio(MessageDataAudio), Document(MessageDataDocument), Photo(MessageDataPhoto), Text(Text), Video(MessageDataVideo), Voice(MessageDataVoice), Unknown(Value),
}
Expand description

Represents a message data.

Variants§

§

Animation(Animation)

Information about the animation.

§

AutoDeleteTimerChanged(MessageDataAutoDeleteTimer)

Auto-delete timer settings changed.

§

BoostAdded(Integer)

Service message: user boosted the chat.

Contains a number of boosts added by the user.

§

ChannelChatCreated

The channel has been created.

This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in the reply_to field of the crate::types::Message struct if someone replies to a very first message in a channel.

§

ChatBackgroundSet(ChatBackground)

Chat background set.

§

ChatShared(MessageDataChatShared)

A chat was shared with the bot.

§

Checklist(Checklist)

Message is a checklist.

§

ChecklistTasksAdded(ChecklistTasksAdded)

Tasks were added to a checklist.

§

ChecklistTasksDone(ChecklistTasksDone)

Some tasks in a checklist were marked as done or not done.

§

ConnectedWebsite(String)

The domain name of the website on which the user has logged in.

§

Contact(Contact)

Information about the shared contact.

§

DeleteChatPhoto

The chat photo was deleted.

§

Dice(Dice)

A dice with a random value.

§

DirectMessagePriceChanged(MessageDataDirectMessagePriceChanged)

The price for paid messages in the corresponding direct messages chat of a channel has changed.

§

ForumTopicClosed

Forum topic closed.

§

ForumTopicCreated(MessageDataForumTopicCreated)

Forum topic created.

§

ForumTopicEdited(MessageDataForumTopicEdited)

Forum topic edited.

§

ForumTopicReopened

Forum topic reopened.

§

Game(Game)

Information about the game.

§

Gift(GiftInfo)

A service message about a sent or received regular gift.

§

GeneralForumTopicHidden

The ‘General’ forum topic hidden.

§

GeneralForumTopicUnhidden

The ‘General’ forum topic unhidden.

§

Giveaway(Giveaway)

A scheduled giveaway.

§

GiveawayCreated(GiveawayCreated)

Service message: a scheduled giveaway was created.

§

GiveawayCompleted(GiveawayCompleted)

Service message: a giveaway without public winners was completed.

§

GiveawayWinners(GiveawayWinners)

A giveaway with public winners was completed.

§

GroupChatCreated

The group has been created.

§

Invoice(Invoice)

Information about the invoice for a payment.

§

LeftChatMember(User)

A member was removed from the group.

This member may be the bot itself.

§

Location(Location)

Information about the shared location.

§

MigrateFromChatId(Integer)

The supergroup has been migrated from a group with the specified identifier.

§

MigrateToChatId(Integer)

The group has been migrated to a supergroup with the specified identifier.

§

NewChatMembers(Vec<User>)

New members that were added to the group or supergroup.

The bot itself may be one of these members.

§

NewChatPhoto(Vec<PhotoSize>)

A chat photo was change to this value.

§

NewChatTitle(String)

A chat title was changed to this value.

§

PaidMedia(PaidMediaInfo)

Message contains paid media; information about the paid media.

§

PaidMessagePriceChanged(MessageDataPaidMessagePriceChanged)

A service message about the changed price for paid messages.

§

PassportData(PassportData)

Telegram Passport data.

§

PinnedMessage(MaybeInaccessibleMessage)

Specified message was pinned.

Note that the Message object in variant will not contain further reply_to field even if it is itself a reply.

§

Poll(Poll)

Information about the native poll.

§

ProximityAlertTriggered(MessageDataProximityAlert)

A user in the chat triggered another user’s proximity alert while sharing Live Location.

§

RefundedPayment(RefundedPayment)

A service message about a refunded payment, information about the payment.

§

Sticker(Sticker)

Information about the sticker.

§

Story(Story)

A forwarded story.

§

SuccessfulPayment(SuccessfulPayment)

Information about the successful payment.

§

SupergroupChatCreated

The supergroup has been created.

This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created It can only be found in the reply_to field of the crate::types::Message struct if someone replies to a very first message in a directly created supergroup.

§

UniqueGift(UniqueGiftInfo)

A service message about a sent or received unique gift.

§

UsersShared(MessageDataUsersShared)

A user was shared with the bot.

§

Venue(Venue)

Information about the venue.

§

VideoNote(VideoNote)

Information about the video note.

§

VideoChatEnded(MessageDataVideoChatEnded)

A video chat ended in the chat.

§

VideoChatParticipantsInvited(MessageDataVideoChatParticipantsInvited)

New members invited to a video chat.

§

VideoChatScheduled(MessageDataVideoChatScheduled)

A video chat scheduled in the chat.

§

VideoChatStarted

A video chat started in the chat.

§

WebAppData(WebAppData)

Data sent by a Web App.

§

WriteAccessAllowed(MessageDataWriteAccess)

The user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

§

Audio(MessageDataAudio)

Describes the audio.

§

Document(MessageDataDocument)

Describes the document.

§

Photo(MessageDataPhoto)

Available sizes of the photo.

§

Text(Text)

The actual UTF-8 text of the message; 0-4096 characters.

§

Video(MessageDataVideo)

Describes the video.

§

Voice(MessageDataVoice)

Describes the voice.

§

Unknown(Value)

Contains arbitrary data for future variants.

Trait Implementations§

Source§

impl Clone for MessageData

Source§

fn clone(&self) -> MessageData

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MessageData

Source§

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

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

impl<'de> Deserialize<'de> for MessageData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MessageData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MessageData

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 MessageData

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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<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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,