Enum tgbot::types::MessageData

source ·
pub enum MessageData {
Show 54 variants Animation(Animation), AutoDeleteTimerChanged(MessageDataAutoDeleteTimer), BoostAdded(Integer), ChannelChatCreated, ChatBackgroundSet(ChatBackground), ChatShared(MessageDataChatShared), ConnectedWebsite(String), Contact(Contact), DeleteChatPhoto, Dice(Dice), ForumTopicClosed, ForumTopicCreated(MessageDataForumTopicCreated), ForumTopicEdited(MessageDataForumTopicEdited), ForumTopicReopened, Game(Game), GeneralForumTopicHidden, GeneralForumTopicUnhidden, Giveaway(Giveaway), GiveawayCreated, GiveawayCompleted(GiveawayCompleted), GiveawayWinners(GiveawayWinners), GroupChatCreated, Invoice(Invoice), LeftChatMember(User), Location(Location), MigrateFromChatId(Integer), MigrateToChatId(Integer), NewChatMembers(Vec<User>), NewChatPhoto(Vec<PhotoSize>), NewChatTitle(String), PassportData(PassportData), PinnedMessage(MaybeInaccessibleMessage), Poll(Poll), ProximityAlertTriggered(MessageDataProximityAlert), Sticker(Sticker), Story(Story), SuccessfulPayment(SuccessfulPayment), SupergroupChatCreated, 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.

§

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.

§

ForumTopicClosed

Forum topic closed.

§

ForumTopicCreated(MessageDataForumTopicCreated)

Forum topic created.

§

ForumTopicEdited(MessageDataForumTopicEdited)

Forum topic edited.

§

ForumTopicReopened

Forum topic reopened.

§

Game(Game)

Information about the game.

§

GeneralForumTopicHidden

The ‘General’ forum topic hidden.

§

GeneralForumTopicUnhidden

The ‘General’ forum topic unhidden.

§

Giveaway(Giveaway)

A scheduled giveaway.

§

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.

§

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.

§

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.

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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> 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> ToOwned for T
where T: Clone,

§

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

§

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

§

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,