pub enum MessageContent {
Show 49 variants MessageAnimatedEmoji(MessageAnimatedEmoji), MessageAnimation(MessageAnimation), MessageAudio(MessageAudio), MessageBasicGroupChatCreate(MessageBasicGroupChatCreate), MessageCall(MessageCall), MessageChatAddMembers(MessageChatAddMembers), MessageChatChangePhoto(MessageChatChangePhoto), MessageChatChangeTitle(MessageChatChangeTitle), MessageChatDeleteMember(MessageChatDeleteMember), MessageChatDeletePhoto(MessageChatDeletePhoto), MessageChatJoinByLink(MessageChatJoinByLink), MessageChatJoinByRequest(MessageChatJoinByRequest), MessageChatSetTheme(MessageChatSetTheme), MessageChatSetTtl(MessageChatSetTtl), MessageChatUpgradeFrom(MessageChatUpgradeFrom), MessageChatUpgradeTo(MessageChatUpgradeTo), MessageContact(MessageContact), MessageContactRegistered(MessageContactRegistered), MessageCustomServiceAction(MessageCustomServiceAction), MessageDice(Box<MessageDice>), MessageDocument(MessageDocument), MessageExpiredPhoto(MessageExpiredPhoto), MessageExpiredVideo(MessageExpiredVideo), MessageGame(MessageGame), MessageGameScore(MessageGameScore), MessageInviteVideoChatParticipants(MessageInviteVideoChatParticipants), MessageInvoice(MessageInvoice), MessageLocation(MessageLocation), MessagePassportDataReceived(MessagePassportDataReceived), MessagePassportDataSent(MessagePassportDataSent), MessagePaymentSuccessful(MessagePaymentSuccessful), MessagePaymentSuccessfulBot(MessagePaymentSuccessfulBot), MessagePhoto(MessagePhoto), MessagePinMessage(MessagePinMessage), MessagePoll(MessagePoll), MessageProximityAlertTriggered(MessageProximityAlertTriggered), MessageScreenshotTaken(MessageScreenshotTaken), MessageSticker(MessageSticker), MessageSupergroupChatCreate(MessageSupergroupChatCreate), MessageText(Box<MessageText>), MessageUnsupported(MessageUnsupported), MessageVenue(MessageVenue), MessageVideo(MessageVideo), MessageVideoChatEnded(MessageVideoChatEnded), MessageVideoChatScheduled(MessageVideoChatScheduled), MessageVideoChatStarted(MessageVideoChatStarted), MessageVideoNote(MessageVideoNote), MessageVoiceNote(MessageVoiceNote), MessageWebsiteConnected(MessageWebsiteConnected), // some variants omitted
}
Expand description

Contains the content of a message

Variants§

§

MessageAnimatedEmoji(MessageAnimatedEmoji)

A message with an animated emoji

§

MessageAnimation(MessageAnimation)

An animation message (GIF-style).

§

MessageAudio(MessageAudio)

An audio message

§

MessageBasicGroupChatCreate(MessageBasicGroupChatCreate)

A newly created basic group

§

MessageCall(MessageCall)

A message with information about an ended call

§

MessageChatAddMembers(MessageChatAddMembers)

New chat members were added

§

MessageChatChangePhoto(MessageChatChangePhoto)

An updated chat photo

§

MessageChatChangeTitle(MessageChatChangeTitle)

An updated chat title

§

MessageChatDeleteMember(MessageChatDeleteMember)

A chat member was deleted

§

MessageChatDeletePhoto(MessageChatDeletePhoto)

A deleted chat photo

A new member joined the chat via an invite link

§

MessageChatJoinByRequest(MessageChatJoinByRequest)

A new member was accepted to the chat by an administrator

§

MessageChatSetTheme(MessageChatSetTheme)

A theme in the chat has been changed

§

MessageChatSetTtl(MessageChatSetTtl)

The TTL (Time To Live) setting for messages in the chat has been changed

§

MessageChatUpgradeFrom(MessageChatUpgradeFrom)

A supergroup has been created from a basic group

§

MessageChatUpgradeTo(MessageChatUpgradeTo)

A basic group was upgraded to a supergroup and was deactivated as the result

§

MessageContact(MessageContact)

A message with a user contact

§

MessageContactRegistered(MessageContactRegistered)

A contact has registered with Telegram

§

MessageCustomServiceAction(MessageCustomServiceAction)

A non-standard action has happened in the chat

§

MessageDice(Box<MessageDice>)

A dice message. The dice value is randomly generated by the server

§

MessageDocument(MessageDocument)

A document message (general file)

§

MessageExpiredPhoto(MessageExpiredPhoto)

An expired photo message (self-destructed after TTL has elapsed)

§

MessageExpiredVideo(MessageExpiredVideo)

An expired video message (self-destructed after TTL has elapsed)

§

MessageGame(MessageGame)

A message with a game

§

MessageGameScore(MessageGameScore)

A new high score was achieved in a game

§

MessageInviteVideoChatParticipants(MessageInviteVideoChatParticipants)

A message with information about an invite to a video chat

§

MessageInvoice(MessageInvoice)

A message with an invoice from a bot

§

MessageLocation(MessageLocation)

A message with a location

§

MessagePassportDataReceived(MessagePassportDataReceived)

Telegram Passport data has been received; for bots only

§

MessagePassportDataSent(MessagePassportDataSent)

Telegram Passport data has been sent

§

MessagePaymentSuccessful(MessagePaymentSuccessful)

A payment has been completed

§

MessagePaymentSuccessfulBot(MessagePaymentSuccessfulBot)

A payment has been completed; for bots only

§

MessagePhoto(MessagePhoto)

A photo message

§

MessagePinMessage(MessagePinMessage)

A message has been pinned

§

MessagePoll(MessagePoll)

A message with a poll

§

MessageProximityAlertTriggered(MessageProximityAlertTriggered)

A user in the chat came within proximity alert range

§

MessageScreenshotTaken(MessageScreenshotTaken)

A screenshot of a message in the chat has been taken

§

MessageSticker(MessageSticker)

A sticker message

§

MessageSupergroupChatCreate(MessageSupergroupChatCreate)

A newly created supergroup or channel

§

MessageText(Box<MessageText>)

A text message

§

MessageUnsupported(MessageUnsupported)

Message content that is not supported in the current TDLib version

§

MessageVenue(MessageVenue)

A message with information about a venue

§

MessageVideo(MessageVideo)

A video message

§

MessageVideoChatEnded(MessageVideoChatEnded)

A message with information about an ended video chat

§

MessageVideoChatScheduled(MessageVideoChatScheduled)

A new video chat was scheduled

§

MessageVideoChatStarted(MessageVideoChatStarted)

A newly created video chat

§

MessageVideoNote(MessageVideoNote)

A video note message

§

MessageVoiceNote(MessageVoiceNote)

A voice note message

§

MessageWebsiteConnected(MessageWebsiteConnected)

The current user has connected a website by logging in using Telegram Login Widget on it

Implementations§

source§

impl MessageContent

source

pub fn from_json<S: AsRef<str>>(json: S) -> Result<Self>

Trait Implementations§

source§

impl AsRef<MessageContent> for MessageContent

source§

fn as_ref(&self) -> &MessageContent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for MessageContent

source§

fn clone(&self) -> MessageContent

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 MessageContent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MessageContent

source§

fn default() -> MessageContent

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for MessageContent

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 Serialize for MessageContent

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> ToOwned for Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,