Enum telegram_bot_fork_raw::types::message::MessageKind
source · pub enum MessageKind {
Show 22 variants
Text {
data: String,
entities: Vec<MessageEntity>,
},
Audio {
data: Audio,
},
Document {
data: Document,
caption: Option<String>,
},
Photo {
data: Vec<PhotoSize>,
caption: Option<String>,
media_group_id: Option<String>,
},
Sticker {
data: Sticker,
},
Video {
data: Video,
caption: Option<String>,
media_group_id: Option<String>,
},
Voice {
data: Voice,
},
VideoNote {
data: VideoNote,
},
Contact {
data: Contact,
},
Location {
data: Location,
},
Venue {
data: Venue,
},
NewChatMembers {
data: Vec<User>,
},
LeftChatMember {
data: User,
},
NewChatTitle {
data: String,
},
NewChatPhoto {
data: Vec<PhotoSize>,
},
DeleteChatPhoto,
GroupChatCreated,
SupergroupChatCreated,
ChannelChatCreated,
MigrateToChatId {
data: Integer,
},
MigrateFromChatId {
data: Integer,
},
PinnedMessage {
data: Box<MessageOrChannelPost>,
},
// some variants omitted
}
Expand description
Kind of the message.
Variants
Text
Fields
data: String
Actual UTF-8 text of the message, 0-4096 characters.
entities: Vec<MessageEntity>
Special entities like usernames, URLs, bot commands, etc. that appear in the text
Text message.
Audio
Fields
data: Audio
Information about the file.
Message is an audio file.
Document
Message is a general file.
Photo
Fields
Caption for the photo, 0-200 characters.
Message is a photo.
Sticker
Fields
data: Sticker
Information about the sticker.
Message is a sticker.
Video
Message is a video.
Voice
Fields
data: Voice
Information about the file.
Message is a voice message.
VideoNote
Fields
data: VideoNote
Information about the file.
Message is a video note.
Contact
Fields
data: Contact
Information about the contact.
Message is a shared contact.
Location
Fields
data: Location
Information about the location.
Message is a shared location.
Venue
Fields
data: Venue
Information about the venue.
Message is a venue.
NewChatMembers
New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
LeftChatMember
Fields
data: User
Information about user (this member may be the bot itself).
A member was removed from the group.
NewChatTitle
Fields
data: String
A chat title was changed to this value.
New chat title.
NewChatPhoto
New chat photo.
DeleteChatPhoto
Service message: the chat photo was deleted.
GroupChatCreated
Service message: the group has been created.
SupergroupChatCreated
Service message: 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 reply_to_message if someone replies to a very first message in a directly created supergroup.
ChannelChatCreated
Service message: 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 reply_to_message if someone replies to a very first message in a channel.
MigrateToChatId
Fields
data: Integer
Supergroup chat identifier.
The group has been migrated to a supergroup.
MigrateFromChatId
Fields
data: Integer
Group chat identifier.
The supergroup has been migrated from a group.
PinnedMessage
Fields
data: Box<MessageOrChannelPost>
Specified message was pinned.
Trait Implementations
sourceimpl Clone for MessageKind
impl Clone for MessageKind
sourcefn clone(&self) -> MessageKind
fn clone(&self) -> MessageKind
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for MessageKind
impl Debug for MessageKind
sourceimpl PartialEq<MessageKind> for MessageKind
impl PartialEq<MessageKind> for MessageKind
sourcefn eq(&self, other: &MessageKind) -> bool
fn eq(&self, other: &MessageKind) -> bool
sourceimpl PartialOrd<MessageKind> for MessageKind
impl PartialOrd<MessageKind> for MessageKind
sourcefn partial_cmp(&self, other: &MessageKind) -> Option<Ordering>
fn partial_cmp(&self, other: &MessageKind) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more