Enum tbot::types::message::Kind

source ·
#[non_exhaustive]
pub enum Kind {
Show 37 variants Text(Text), Audio { audio: Box<Audio>, caption: Text, media_group_id: Option<String>, }, Document { document: Box<Document>, caption: Text, media_group_id: Option<String>, }, Dice(Dice), Game(Box<Game>), Photo { photo: Vec<PhotoSize>, caption: Text, media_group_id: Option<String>, }, Sticker(Box<Sticker>), Video { video: Box<Video>, caption: Text, media_group_id: Option<String>, }, Voice { voice: Voice, caption: Text, }, VideoNote(VideoNote), Contact(Contact), Location(Location), Venue(Venue), Animation { animation: Box<Animation>, caption: Text, }, Poll(Poll), NewChatMembers(Vec<User>), LeftChatMember(User), NewChatTitle(String), NewChatPhoto(Vec<PhotoSize>), ChatPhotoDeleted, GroupCreated, SupergroupCreated, ChannelCreated, MigrateTo(Id), MigrateFrom(Id), Pinned(Box<Message>), Invoice(Invoice), SuccessfulPayment(Box<SuccessfulPayment>), ConnectedWebsite(String), PassportData(Data), ProximityAlert(ProximityAlert), VoiceChatStarted, VoiceChatParticipantsInvited(ParticipantsInvited), VoiceChatEnded(Ended), VoiceChatScheduled(Scheduled), AutoDeleteTimerChanged(AutoDeleteTimerChanged), Unknown,
}
Expand description

Represents kinds of messages.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Text(Text)

A text message.

§

Audio

Fields

§audio: Box<Audio>

The audio itself.

§caption: Text

The audio’s caption.

§media_group_id: Option<String>

If the audio is a part of an album, this is the album’s ID.

An audio.

§

Document

Fields

§document: Box<Document>

The document itself.

§caption: Text

The document’s caption.

§media_group_id: Option<String>

If the document is a part of an album, this is the album’s ID.

A document.

§

Dice(Dice)

A dice.

§

Game(Box<Game>)

An invitation to play a game.

§

Photo

Fields

§photo: Vec<PhotoSize>

The photo itself.

§caption: Text

The photo’s caption.

§media_group_id: Option<String>

If the photo is a part of an album, this is the album’s ID.

A photo.

§

Sticker(Box<Sticker>)

A sticker.

§

Video

Fields

§video: Box<Video>

The video itself.

§caption: Text

The video’s caption.

§media_group_id: Option<String>

If the video is a part of an album, this is the album’s ID.

A video.

§

Voice

Fields

§voice: Voice

The voice itself.

§caption: Text

The voice’s caption.

A voice message. The second item is the caption.

§

VideoNote(VideoNote)

A video note.

§

Contact(Contact)

A contact.

§

Location(Location)

A location.

§

Venue(Venue)

A venue.

§

Animation

Fields

§animation: Box<Animation>

The animation itself.

§caption: Text

The animation’s caption.

An animation.

§

Poll(Poll)

A poll.

§

NewChatMembers(Vec<User>)

A service message about new chat members.

§

LeftChatMember(User)

A service message about a member who left.

§

NewChatTitle(String)

A service message about the new chat title.

§

NewChatPhoto(Vec<PhotoSize>)

A service message about the new chat photo.

§

ChatPhotoDeleted

A service message that the chat photo was deleted.

§

GroupCreated

A service message that the group was created.

§

SupergroupCreated

A service message that the supergroup was created.

§

ChannelCreated

A service message that the channel was created.

§

MigrateTo(Id)

A service message that the group migrated to a supergroup with this ID.

§

MigrateFrom(Id)

A service message that the supergroup used to be a group with this ID.

§

Pinned(Box<Message>)

A service message that this message was pinned.

§

Invoice(Invoice)

An invoice.

§

SuccessfulPayment(Box<SuccessfulPayment>)

A service message about a successful payment.

§

ConnectedWebsite(String)

A connected website.

§

PassportData(Data)

Passport data.

§

ProximityAlert(ProximityAlert)

A proximity alert.

§

VoiceChatStarted

A voice chat was started.

§

VoiceChatParticipantsInvited(ParticipantsInvited)

Participants were invited to a voice chat.

§

VoiceChatEnded(Ended)

A voice chat was ended.

§

VoiceChatScheduled(Scheduled)

A voice chat was scheduled.

§

AutoDeleteTimerChanged(AutoDeleteTimerChanged)

The auto-delete time was changed.

§

Unknown

Some unkonwn message kind. Probably means tbot is outdated.

Implementations§

Returns true if self is of variant Text.

Unwraps the value, yielding the content of Text.

Panics

Panics if the value is not Text, with a panic message including the content of self.

Returns Some if self is of variant Text, and None otherwise.

Returns true if self is of variant Audio.

Returns true if self is of variant Document.

Returns true if self is of variant Dice.

Unwraps the value, yielding the content of Dice.

Panics

Panics if the value is not Dice, with a panic message including the content of self.

Returns Some if self is of variant Dice, and None otherwise.

Returns true if self is of variant Game.

Unwraps the value, yielding the content of Game.

Panics

Panics if the value is not Game, with a panic message including the content of self.

Returns Some if self is of variant Game, and None otherwise.

Returns true if self is of variant Photo.

Returns true if self is of variant Sticker.

Unwraps the value, yielding the content of Sticker.

Panics

Panics if the value is not Sticker, with a panic message including the content of self.

Returns Some if self is of variant Sticker, and None otherwise.

Returns true if self is of variant Video.

Returns true if self is of variant Voice.

Returns true if self is of variant VideoNote.

Unwraps the value, yielding the content of VideoNote.

Panics

Panics if the value is not VideoNote, with a panic message including the content of self.

Returns Some if self is of variant VideoNote, and None otherwise.

Returns true if self is of variant Contact.

Unwraps the value, yielding the content of Contact.

Panics

Panics if the value is not Contact, with a panic message including the content of self.

Returns Some if self is of variant Contact, and None otherwise.

Returns true if self is of variant Location.

Unwraps the value, yielding the content of Location.

Panics

Panics if the value is not Location, with a panic message including the content of self.

Returns Some if self is of variant Location, and None otherwise.

Returns true if self is of variant Venue.

Unwraps the value, yielding the content of Venue.

Panics

Panics if the value is not Venue, with a panic message including the content of self.

Returns Some if self is of variant Venue, and None otherwise.

Returns true if self is of variant Animation.

Returns true if self is of variant Poll.

Unwraps the value, yielding the content of Poll.

Panics

Panics if the value is not Poll, with a panic message including the content of self.

Returns Some if self is of variant Poll, and None otherwise.

Returns true if self is of variant NewChatMembers.

Unwraps the value, yielding the content of NewChatMembers.

Panics

Panics if the value is not NewChatMembers, with a panic message including the content of self.

Returns Some if self is of variant NewChatMembers, and None otherwise.

Returns true if self is of variant LeftChatMember.

Unwraps the value, yielding the content of LeftChatMember.

Panics

Panics if the value is not LeftChatMember, with a panic message including the content of self.

Returns Some if self is of variant LeftChatMember, and None otherwise.

Returns true if self is of variant NewChatTitle.

Unwraps the value, yielding the content of NewChatTitle.

Panics

Panics if the value is not NewChatTitle, with a panic message including the content of self.

Returns Some if self is of variant NewChatTitle, and None otherwise.

Returns true if self is of variant NewChatPhoto.

Unwraps the value, yielding the content of NewChatPhoto.

Panics

Panics if the value is not NewChatPhoto, with a panic message including the content of self.

Returns Some if self is of variant NewChatPhoto, and None otherwise.

Returns true if self is of variant ChatPhotoDeleted.

Returns true if self is of variant GroupCreated.

Returns true if self is of variant SupergroupCreated.

Returns true if self is of variant ChannelCreated.

Returns true if self is of variant MigrateTo.

Unwraps the value, yielding the content of MigrateTo.

Panics

Panics if the value is not MigrateTo, with a panic message including the content of self.

Returns Some if self is of variant MigrateTo, and None otherwise.

Returns true if self is of variant MigrateFrom.

Unwraps the value, yielding the content of MigrateFrom.

Panics

Panics if the value is not MigrateFrom, with a panic message including the content of self.

Returns Some if self is of variant MigrateFrom, and None otherwise.

Returns true if self is of variant Pinned.

Unwraps the value, yielding the content of Pinned.

Panics

Panics if the value is not Pinned, with a panic message including the content of self.

Returns Some if self is of variant Pinned, and None otherwise.

Returns true if self is of variant Invoice.

Unwraps the value, yielding the content of Invoice.

Panics

Panics if the value is not Invoice, with a panic message including the content of self.

Returns Some if self is of variant Invoice, and None otherwise.

Returns true if self is of variant SuccessfulPayment.

Unwraps the value, yielding the content of SuccessfulPayment.

Panics

Panics if the value is not SuccessfulPayment, with a panic message including the content of self.

Returns Some if self is of variant SuccessfulPayment, and None otherwise.

Returns true if self is of variant ConnectedWebsite.

Unwraps the value, yielding the content of ConnectedWebsite.

Panics

Panics if the value is not ConnectedWebsite, with a panic message including the content of self.

Returns Some if self is of variant ConnectedWebsite, and None otherwise.

Returns true if self is of variant PassportData.

Unwraps the value, yielding the content of PassportData.

Panics

Panics if the value is not PassportData, with a panic message including the content of self.

Returns Some if self is of variant PassportData, and None otherwise.

Returns true if self is of variant ProximityAlert.

Unwraps the value, yielding the content of ProximityAlert.

Panics

Panics if the value is not ProximityAlert, with a panic message including the content of self.

Returns Some if self is of variant ProximityAlert, and None otherwise.

Returns true if self is of variant VoiceChatStarted.

Returns true if self is of variant VoiceChatParticipantsInvited.

Unwraps the value, yielding the content of VoiceChatParticipantsInvited.

Panics

Panics if the value is not VoiceChatParticipantsInvited, with a panic message including the content of self.

Returns Some if self is of variant VoiceChatParticipantsInvited, and None otherwise.

Returns true if self is of variant VoiceChatEnded.

Unwraps the value, yielding the content of VoiceChatEnded.

Panics

Panics if the value is not VoiceChatEnded, with a panic message including the content of self.

Returns Some if self is of variant VoiceChatEnded, and None otherwise.

Returns true if self is of variant VoiceChatScheduled.

Unwraps the value, yielding the content of VoiceChatScheduled.

Panics

Panics if the value is not VoiceChatScheduled, with a panic message including the content of self.

Returns Some if self is of variant VoiceChatScheduled, and None otherwise.

Returns true if self is of variant AutoDeleteTimerChanged.

Unwraps the value, yielding the content of AutoDeleteTimerChanged.

Panics

Panics if the value is not AutoDeleteTimerChanged, with a panic message including the content of self.

Returns Some if self is of variant AutoDeleteTimerChanged, and None otherwise.

Returns true if self is of variant Unknown.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more