Enum tbot::types::message::Kind[][src]

#[non_exhaustive]
pub enum Kind {
Show 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,
}

Represents kinds of messages.

Variants (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

An audio.

Show fields

Fields of Audio

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.

Document

A document.

Show fields

Fields of Document

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.

Dice(Dice)

A dice.

Game(Box<Game>)

An invitation to play a game.

Photo

A photo.

Show fields

Fields of Photo

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.

Sticker(Box<Sticker>)

A sticker.

Video

A video.

Show fields

Fields of Video

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.

Voice

A voice message. The second item is the caption.

Show fields

Fields of Voice

voice: Voice

The voice itself.

caption: Text

The voice’s caption.

VideoNote(VideoNote)

A video note.

Contact(Contact)

A contact.

Location(Location)

A location.

Venue(Venue)

A venue.

Animation

An animation.

Show fields

Fields of Animation

animation: Box<Animation>

The animation itself.

caption: Text

The animation’s caption.

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

impl Kind[src]

pub fn is_text(&self) -> bool[src]

Returns true if self is of variant Text.

pub fn expect_text(self) -> Text where
    Self: Debug
[src]

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.

pub fn text(self) -> Option<Text>[src]

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

pub fn is_audio(&self) -> bool[src]

Returns true if self is of variant Audio.

pub fn is_document(&self) -> bool[src]

Returns true if self is of variant Document.

pub fn is_dice(&self) -> bool[src]

Returns true if self is of variant Dice.

pub fn expect_dice(self) -> Dice where
    Self: Debug
[src]

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.

pub fn dice(self) -> Option<Dice>[src]

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

pub fn is_game(&self) -> bool[src]

Returns true if self is of variant Game.

pub fn expect_game(self) -> Box<Game> where
    Self: Debug
[src]

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.

pub fn game(self) -> Option<Box<Game>>[src]

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

pub fn is_photo(&self) -> bool[src]

Returns true if self is of variant Photo.

pub fn is_sticker(&self) -> bool[src]

Returns true if self is of variant Sticker.

pub fn expect_sticker(self) -> Box<Sticker> where
    Self: Debug
[src]

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.

pub fn sticker(self) -> Option<Box<Sticker>>[src]

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

pub fn is_video(&self) -> bool[src]

Returns true if self is of variant Video.

pub fn is_voice(&self) -> bool[src]

Returns true if self is of variant Voice.

pub fn is_video_note(&self) -> bool[src]

Returns true if self is of variant VideoNote.

pub fn expect_video_note(self) -> VideoNote where
    Self: Debug
[src]

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.

pub fn video_note(self) -> Option<VideoNote>[src]

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

pub fn is_contact(&self) -> bool[src]

Returns true if self is of variant Contact.

pub fn expect_contact(self) -> Contact where
    Self: Debug
[src]

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.

pub fn contact(self) -> Option<Contact>[src]

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

pub fn is_location(&self) -> bool[src]

Returns true if self is of variant Location.

pub fn expect_location(self) -> Location where
    Self: Debug
[src]

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.

pub fn location(self) -> Option<Location>[src]

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

pub fn is_venue(&self) -> bool[src]

Returns true if self is of variant Venue.

pub fn expect_venue(self) -> Venue where
    Self: Debug
[src]

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.

pub fn venue(self) -> Option<Venue>[src]

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

pub fn is_animation(&self) -> bool[src]

Returns true if self is of variant Animation.

pub fn is_poll(&self) -> bool[src]

Returns true if self is of variant Poll.

pub fn expect_poll(self) -> Poll where
    Self: Debug
[src]

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.

pub fn poll(self) -> Option<Poll>[src]

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

pub fn is_new_chat_members(&self) -> bool[src]

Returns true if self is of variant NewChatMembers.

pub fn expect_new_chat_members(self) -> Vec<User> where
    Self: Debug
[src]

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.

pub fn new_chat_members(self) -> Option<Vec<User>>[src]

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

pub fn is_left_chat_member(&self) -> bool[src]

Returns true if self is of variant LeftChatMember.

pub fn expect_left_chat_member(self) -> User where
    Self: Debug
[src]

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.

pub fn left_chat_member(self) -> Option<User>[src]

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

pub fn is_new_chat_title(&self) -> bool[src]

Returns true if self is of variant NewChatTitle.

pub fn expect_new_chat_title(self) -> String where
    Self: Debug
[src]

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.

pub fn new_chat_title(self) -> Option<String>[src]

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

pub fn is_new_chat_photo(&self) -> bool[src]

Returns true if self is of variant NewChatPhoto.

pub fn expect_new_chat_photo(self) -> Vec<PhotoSize> where
    Self: Debug
[src]

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.

pub fn new_chat_photo(self) -> Option<Vec<PhotoSize>>[src]

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

pub fn is_chat_photo_deleted(&self) -> bool[src]

Returns true if self is of variant ChatPhotoDeleted.

pub fn is_group_created(&self) -> bool[src]

Returns true if self is of variant GroupCreated.

pub fn is_supergroup_created(&self) -> bool[src]

Returns true if self is of variant SupergroupCreated.

pub fn is_channel_created(&self) -> bool[src]

Returns true if self is of variant ChannelCreated.

pub fn is_migrate_to(&self) -> bool[src]

Returns true if self is of variant MigrateTo.

pub fn expect_migrate_to(self) -> Id where
    Self: Debug
[src]

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.

pub fn migrate_to(self) -> Option<Id>[src]

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

pub fn is_migrate_from(&self) -> bool[src]

Returns true if self is of variant MigrateFrom.

pub fn expect_migrate_from(self) -> Id where
    Self: Debug
[src]

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.

pub fn migrate_from(self) -> Option<Id>[src]

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

pub fn is_pinned(&self) -> bool[src]

Returns true if self is of variant Pinned.

pub fn expect_pinned(self) -> Box<Message> where
    Self: Debug
[src]

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.

pub fn pinned(self) -> Option<Box<Message>>[src]

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

pub fn is_invoice(&self) -> bool[src]

Returns true if self is of variant Invoice.

pub fn expect_invoice(self) -> Invoice where
    Self: Debug
[src]

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.

pub fn invoice(self) -> Option<Invoice>[src]

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

pub fn is_successful_payment(&self) -> bool[src]

Returns true if self is of variant SuccessfulPayment.

pub fn expect_successful_payment(self) -> Box<SuccessfulPayment> where
    Self: Debug
[src]

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.

pub fn successful_payment(self) -> Option<Box<SuccessfulPayment>>[src]

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

pub fn is_connected_website(&self) -> bool[src]

Returns true if self is of variant ConnectedWebsite.

pub fn expect_connected_website(self) -> String where
    Self: Debug
[src]

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.

pub fn connected_website(self) -> Option<String>[src]

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

pub fn is_passport_data(&self) -> bool[src]

Returns true if self is of variant PassportData.

pub fn expect_passport_data(self) -> Data where
    Self: Debug
[src]

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.

pub fn passport_data(self) -> Option<Data>[src]

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

pub fn is_proximity_alert(&self) -> bool[src]

Returns true if self is of variant ProximityAlert.

pub fn expect_proximity_alert(self) -> ProximityAlert where
    Self: Debug
[src]

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.

pub fn proximity_alert(self) -> Option<ProximityAlert>[src]

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

pub fn is_voice_chat_started(&self) -> bool[src]

Returns true if self is of variant VoiceChatStarted.

pub fn is_voice_chat_participants_invited(&self) -> bool[src]

Returns true if self is of variant VoiceChatParticipantsInvited.

pub fn expect_voice_chat_participants_invited(self) -> ParticipantsInvited where
    Self: Debug
[src]

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.

pub fn voice_chat_participants_invited(self) -> Option<ParticipantsInvited>[src]

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

pub fn is_voice_chat_ended(&self) -> bool[src]

Returns true if self is of variant VoiceChatEnded.

pub fn expect_voice_chat_ended(self) -> Ended where
    Self: Debug
[src]

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.

pub fn voice_chat_ended(self) -> Option<Ended>[src]

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

pub fn is_voice_chat_scheduled(&self) -> bool[src]

Returns true if self is of variant VoiceChatScheduled.

pub fn expect_voice_chat_scheduled(self) -> Scheduled where
    Self: Debug
[src]

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.

pub fn voice_chat_scheduled(self) -> Option<Scheduled>[src]

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

pub fn is_auto_delete_timer_changed(&self) -> bool[src]

Returns true if self is of variant AutoDeleteTimerChanged.

pub fn expect_auto_delete_timer_changed(self) -> AutoDeleteTimerChanged where
    Self: Debug
[src]

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.

pub fn auto_delete_timer_changed(self) -> Option<AutoDeleteTimerChanged>[src]

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

pub fn is_unknown(&self) -> bool[src]

Returns true if self is of variant Unknown.

Trait Implementations

impl Clone for Kind[src]

impl Debug for Kind[src]

impl PartialEq<Kind> for Kind[src]

impl StructuralPartialEq for Kind[src]

Auto Trait Implementations

impl RefUnwindSafe for Kind

impl Send for Kind

impl Sync for Kind

impl Unpin for Kind

impl UnwindSafe for Kind

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.