Enum apid_telegram_bot::MessageContent
source · [−]pub enum MessageContent {
Show 35 variants
Text {
text: String,
entities: Vec<MessageEntity>,
},
Animation {
animation: Animation,
document: Document,
caption: Option<Caption>,
},
Audio {
audio: Audio,
caption: Option<Caption>,
},
Document {
document: Document,
caption: Option<Caption>,
},
Photo {
photo: Vec<PhotoSize>,
caption: Option<Caption>,
},
Sticker(Sticker),
Video {
video: Video,
caption: Option<Caption>,
},
VideoNote(VideoNote),
Voice {
voice: Voice,
caption: Option<Caption>,
},
Contact(Contact),
Dice(Dice),
Game(Game),
Poll(Poll),
Venue {
venue: Venue,
location: Location,
},
Location(Location),
NewChatMembers {
new_chat_members: Vec<User>,
},
LeftChatMember {
left_chat_member: User,
},
NewChatTitle {
new_chat_title: String,
},
NewChatPhoto {
new_chat_photo: Vec<PhotoSize>,
},
DeleteChatPhoto {
delete_chat_photo: bool,
},
GroupChatCreated {
group_chat_created: bool,
},
SupergroupChatCreated {
supergroup_chat_created: bool,
},
ChannelChatCreated {
channel_chat_created: bool,
},
MessageAutoDeleteTimerChanged {
message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged,
},
MigrateToChatId {
migrate_to_chat_id: i64,
},
MigrateFromChatId {
migrate_from_chat_id: i64,
},
PinnedMessage {
pinned_message: Box<Message>,
},
Invoice {
invoice: Invoice,
},
SuccessfulPayment {
successful_payment: SuccessfulPayment,
},
Login {
connected_website: String,
passport_data: PassportData,
},
ProximityAlertTriggered {
proximity_alert_triggered: ProximityAlertTriggered,
},
VideoChatScheduled(VideoChatScheduled),
VideoChatStarted(VideoChatStarted),
VideoChatEnded(VideoChatEnded),
VideoChatParticipantsInvited(VideoChatParticipantsInvited),
}Expand description
The object representing message content
Variants
Text
Fields
text: StringFor text messages, the actual UTF-8 text of the message
entities: Vec<MessageEntity>For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
Message is a text message
Animation
Fields
animation: AnimationMessage is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
document: DocumentMessage is a general file, information about the file
Message is an animation
Audio
Fields
audio: AudioMessage is an audio file, information about the file
Message is an audio file
Document
Fields
document: DocumentMessage is a general file, information about the file
Message is a general file
Photo
Fields
Message is a photo
Sticker(Sticker)
Message is a sticker
Video
Fields
video: VideoMessage is a video, information about the video
Message is a video
VideoNote(VideoNote)
Message is a video note
Voice
Fields
voice: VoiceMessage is a voice message, information about the file
Message is a voice message
Contact(Contact)
Message is a shared contact
Dice(Dice)
Message is a dice with random value
Game(Game)
Message is a game. More about games »
Poll(Poll)
Message is a native poll
Venue
Fields
venue: VenueMessage is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
location: Locationinformation about the location
Message is a venue.
Location(Location)
Message is a shared location
NewChatMembers
Fields
LeftChatMember
Fields
left_chat_member: UserA member was removed from the group, information about them (this member may be the bot itself)
NewChatTitle
Fields
new_chat_title: StringA chat title was changed to this value
NewChatPhoto
DeleteChatPhoto
Fields
delete_chat_photo: boolService message: the chat photo was deleted
GroupChatCreated
Fields
group_chat_created: boolService message: the group has been created
SupergroupChatCreated
Fields
supergroup_chat_created: boolService 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
Fields
channel_chat_created: boolService 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.
MessageAutoDeleteTimerChanged
Fields
message_auto_delete_timer_changed: MessageAutoDeleteTimerChangedService message: auto-delete timer settings changed in the chat
MigrateToChatId
Fields
migrate_to_chat_id: i64The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
MigrateFromChatId
Fields
migrate_from_chat_id: i64The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
PinnedMessage
Fields
Invoice
Fields
invoice: InvoiceMessage is an invoice for a payment, information about the invoice. More about payments »
SuccessfulPayment
Fields
successful_payment: SuccessfulPaymentMessage is a service message about a successful payment, information about the payment. More about payments »
Login
Fields
connected_website: StringThe domain name of the website on which the user has logged in. More about Telegram Login »
passport_data: PassportDataTelegram Passport data
ProximityAlertTriggered
Fields
proximity_alert_triggered: ProximityAlertTriggeredService message. A user in the chat triggered another user’s proximity alert while sharing Live Location.
VideoChatScheduled(VideoChatScheduled)
Service message: video chat scheduled
VideoChatStarted(VideoChatStarted)
Service message: video chat started
VideoChatEnded(VideoChatEnded)
Service message: video chat ended
VideoChatParticipantsInvited(VideoChatParticipantsInvited)
Service message: new participants invited to a video chat
Trait Implementations
sourceimpl Debug for MessageContent
impl Debug for MessageContent
sourceimpl<'de> Deserialize<'de> for MessageContent
impl<'de> Deserialize<'de> for MessageContent
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for MessageContent
impl Serialize for MessageContent
Auto Trait Implementations
impl RefUnwindSafe for MessageContent
impl Send for MessageContent
impl Sync for MessageContent
impl Unpin for MessageContent
impl UnwindSafe for MessageContent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more