Skip to main content

MessageContent

Enum MessageContent 

Source
pub enum MessageContent {
Show 95 variants MessageText(MessageText), MessageAnimation(MessageAnimation), MessageAudio(MessageAudio), MessageDocument(MessageDocument), MessagePaidMedia(MessagePaidMedia), MessagePhoto(MessagePhoto), MessageSticker(MessageSticker), MessageVideo(MessageVideo), MessageVideoNote(MessageVideoNote), MessageVoiceNote(MessageVoiceNote), MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation(MessageLocation), MessageVenue(MessageVenue), MessageContact(MessageContact), MessageAnimatedEmoji(MessageAnimatedEmoji), MessageDice(MessageDice), MessageGame(MessageGame), MessagePoll(MessagePoll), MessageStakeDice(MessageStakeDice), MessageStory(MessageStory), MessageChecklist(MessageChecklist), MessageInvoice(MessageInvoice), MessageCall(MessageCall), MessageGroupCall(MessageGroupCall), MessageVideoChatScheduled(MessageVideoChatScheduled), MessageVideoChatStarted(MessageVideoChatStarted), MessageVideoChatEnded(MessageVideoChatEnded), MessageInviteVideoChatParticipants(MessageInviteVideoChatParticipants), MessageBasicGroupChatCreate(MessageBasicGroupChatCreate), MessageSupergroupChatCreate(MessageSupergroupChatCreate), MessageChatChangeTitle(MessageChatChangeTitle), MessageChatChangePhoto(MessageChatChangePhoto), MessageChatDeletePhoto, MessageChatOwnerLeft(MessageChatOwnerLeft), MessageChatOwnerChanged(MessageChatOwnerChanged), MessageChatAddMembers(MessageChatAddMembers), MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember(MessageChatDeleteMember), MessageChatUpgradeTo(MessageChatUpgradeTo), MessageChatUpgradeFrom(MessageChatUpgradeFrom), MessagePinMessage(MessagePinMessage), MessageScreenshotTaken, MessageChatSetBackground(MessageChatSetBackground), MessageChatSetTheme(MessageChatSetTheme), MessageChatSetMessageAutoDeleteTime(MessageChatSetMessageAutoDeleteTime), MessageChatBoost(MessageChatBoost), MessageForumTopicCreated(MessageForumTopicCreated), MessageForumTopicEdited(MessageForumTopicEdited), MessageForumTopicIsClosedToggled(MessageForumTopicIsClosedToggled), MessageForumTopicIsHiddenToggled(MessageForumTopicIsHiddenToggled), MessageSuggestProfilePhoto(MessageSuggestProfilePhoto), MessageSuggestBirthdate(MessageSuggestBirthdate), MessageCustomServiceAction(MessageCustomServiceAction), MessageGameScore(MessageGameScore), MessagePaymentSuccessful(MessagePaymentSuccessful), MessagePaymentSuccessfulBot(MessagePaymentSuccessfulBot), MessagePaymentRefunded(MessagePaymentRefunded), MessageGiftedPremium(MessageGiftedPremium), MessagePremiumGiftCode(MessagePremiumGiftCode), MessageGiveawayCreated(MessageGiveawayCreated), MessageGiveaway(MessageGiveaway), MessageGiveawayCompleted(MessageGiveawayCompleted), MessageGiveawayWinners(MessageGiveawayWinners), MessageGiftedStars(MessageGiftedStars), MessageGiftedTon(MessageGiftedTon), MessageGiveawayPrizeStars(MessageGiveawayPrizeStars), MessageGift(MessageGift), MessageUpgradedGift(MessageUpgradedGift), MessageRefundedUpgradedGift(MessageRefundedUpgradedGift), MessageUpgradedGiftPurchaseOffer(MessageUpgradedGiftPurchaseOffer), MessageUpgradedGiftPurchaseOfferRejected(MessageUpgradedGiftPurchaseOfferRejected), MessagePaidMessagesRefunded(MessagePaidMessagesRefunded), MessagePaidMessagePriceChanged(MessagePaidMessagePriceChanged), MessageDirectMessagePriceChanged(MessageDirectMessagePriceChanged), MessageChecklistTasksDone(MessageChecklistTasksDone), MessageChecklistTasksAdded(MessageChecklistTasksAdded), MessageSuggestedPostApprovalFailed(MessageSuggestedPostApprovalFailed), MessageSuggestedPostApproved(MessageSuggestedPostApproved), MessageSuggestedPostDeclined(MessageSuggestedPostDeclined), MessageSuggestedPostPaid(MessageSuggestedPostPaid), MessageSuggestedPostRefunded(MessageSuggestedPostRefunded), MessageContactRegistered, MessageUsersShared(MessageUsersShared), MessageChatShared(MessageChatShared), MessageBotWriteAccessAllowed(MessageBotWriteAccessAllowed), MessageWebAppDataSent(MessageWebAppDataSent), MessageWebAppDataReceived(MessageWebAppDataReceived), MessagePassportDataSent(MessagePassportDataSent), MessagePassportDataReceived(MessagePassportDataReceived), MessageProximityAlertTriggered(MessageProximityAlertTriggered), MessageUnsupported,
}

Variants§

§

MessageText(MessageText)

A text message

§

MessageAnimation(MessageAnimation)

An animation message (GIF-style).

§

MessageAudio(MessageAudio)

An audio message

§

MessageDocument(MessageDocument)

A document message (general file)

§

MessagePaidMedia(MessagePaidMedia)

A message with paid media

§

MessagePhoto(MessagePhoto)

A photo message

§

MessageSticker(MessageSticker)

A sticker message

§

MessageVideo(MessageVideo)

A video message

§

MessageVideoNote(MessageVideoNote)

A video note message

§

MessageVoiceNote(MessageVoiceNote)

A voice note message

§

MessageExpiredPhoto

A self-destructed photo message

§

MessageExpiredVideo

A self-destructed video message

§

MessageExpiredVideoNote

A self-destructed video note message

§

MessageExpiredVoiceNote

A self-destructed voice note message

§

MessageLocation(MessageLocation)

A message with a location

§

MessageVenue(MessageVenue)

A message with information about a venue

§

MessageContact(MessageContact)

A message with a user contact

§

MessageAnimatedEmoji(MessageAnimatedEmoji)

A message with an animated emoji

§

MessageDice(MessageDice)

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

§

MessageGame(MessageGame)

A message with a game

§

MessagePoll(MessagePoll)

A message with a poll

§

MessageStakeDice(MessageStakeDice)

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

§

MessageStory(MessageStory)

A message with a forwarded story

§

MessageChecklist(MessageChecklist)

A message with a checklist

§

MessageInvoice(MessageInvoice)

A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice

§

MessageCall(MessageCall)

A message with information about an ended call

§

MessageGroupCall(MessageGroupCall)

A message with information about a group call not bound to a chat. If the message is incoming, the call isn’t active, isn’t missed, and has no duration, and getOption(“can_accept_calls”) is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden

§

MessageVideoChatScheduled(MessageVideoChatScheduled)

A new video chat was scheduled

§

MessageVideoChatStarted(MessageVideoChatStarted)

A newly created video chat

§

MessageVideoChatEnded(MessageVideoChatEnded)

A message with information about an ended video chat

§

MessageInviteVideoChatParticipants(MessageInviteVideoChatParticipants)

A message with information about an invitation to a video chat

§

MessageBasicGroupChatCreate(MessageBasicGroupChatCreate)

A newly created basic group

§

MessageSupergroupChatCreate(MessageSupergroupChatCreate)

A newly created supergroup or channel

§

MessageChatChangeTitle(MessageChatChangeTitle)

An updated chat title

§

MessageChatChangePhoto(MessageChatChangePhoto)

An updated chat photo

§

MessageChatDeletePhoto

A deleted chat photo

§

MessageChatOwnerLeft(MessageChatOwnerLeft)

The owner of the chat has left

§

MessageChatOwnerChanged(MessageChatOwnerChanged)

The owner of the chat has changed

§

MessageChatAddMembers(MessageChatAddMembers)

New chat members were added

A new member joined the chat via an invite link

§

MessageChatJoinByRequest

A new member was accepted to the chat by an administrator

§

MessageChatDeleteMember(MessageChatDeleteMember)

A chat member was deleted

§

MessageChatUpgradeTo(MessageChatUpgradeTo)

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

§

MessageChatUpgradeFrom(MessageChatUpgradeFrom)

A supergroup has been created from a basic group

§

MessagePinMessage(MessagePinMessage)

A message has been pinned

§

MessageScreenshotTaken

A screenshot of a message in the chat has been taken

§

MessageChatSetBackground(MessageChatSetBackground)

A new background was set in the chat

§

MessageChatSetTheme(MessageChatSetTheme)

A theme in the chat has been changed

§

MessageChatSetMessageAutoDeleteTime(MessageChatSetMessageAutoDeleteTime)

The auto-delete or self-destruct timer for messages in the chat has been changed

§

MessageChatBoost(MessageChatBoost)

The chat was boosted by the sender of the message

§

MessageForumTopicCreated(MessageForumTopicCreated)

A forum topic has been created

§

MessageForumTopicEdited(MessageForumTopicEdited)

A forum topic has been edited

§

MessageForumTopicIsClosedToggled(MessageForumTopicIsClosedToggled)

A forum topic has been closed or opened

§

MessageForumTopicIsHiddenToggled(MessageForumTopicIsHiddenToggled)

A General forum topic has been hidden or unhidden

§

MessageSuggestProfilePhoto(MessageSuggestProfilePhoto)

A profile photo was suggested to a user in a private chat

§

MessageSuggestBirthdate(MessageSuggestBirthdate)

A birthdate was suggested to be set

§

MessageCustomServiceAction(MessageCustomServiceAction)

A non-standard action has happened in the chat

§

MessageGameScore(MessageGameScore)

A new high score was achieved in a game

§

MessagePaymentSuccessful(MessagePaymentSuccessful)

A payment has been sent to a bot or a business account

§

MessagePaymentSuccessfulBot(MessagePaymentSuccessfulBot)

A payment has been received by the bot or the business account

§

MessagePaymentRefunded(MessagePaymentRefunded)

A payment has been refunded

§

MessageGiftedPremium(MessageGiftedPremium)

Telegram Premium was gifted to a user

§

MessagePremiumGiftCode(MessagePremiumGiftCode)

A Telegram Premium gift code was created for the user

§

MessageGiveawayCreated(MessageGiveawayCreated)

A giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway, telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to create a giveaway

§

MessageGiveaway(MessageGiveaway)

A giveaway

§

MessageGiveawayCompleted(MessageGiveawayCompleted)

A giveaway without public winners has been completed for the chat

§

MessageGiveawayWinners(MessageGiveawayWinners)

A giveaway with public winners has been completed for the chat

§

MessageGiftedStars(MessageGiftedStars)

Telegram Stars were gifted to a user

§

MessageGiftedTon(MessageGiftedTon)

Toncoins were gifted to a user

§

MessageGiveawayPrizeStars(MessageGiveawayPrizeStars)

A Telegram Stars were received by the current user from a giveaway

§

MessageGift(MessageGift)

A regular gift was received or sent by the current user, or the current user was notified about a channel gift

§

MessageUpgradedGift(MessageUpgradedGift)

An upgraded gift was received or sent by the current user, or the current user was notified about a channel gift

§

MessageRefundedUpgradedGift(MessageRefundedUpgradedGift)

A gift which purchase, upgrade or transfer were refunded

§

MessageUpgradedGiftPurchaseOffer(MessageUpgradedGiftPurchaseOffer)

An offer to purchase an upgraded gift was sent or received

§

MessageUpgradedGiftPurchaseOfferRejected(MessageUpgradedGiftPurchaseOfferRejected)

An offer to purchase a gift was rejected or expired

§

MessagePaidMessagesRefunded(MessagePaidMessagesRefunded)

Paid messages were refunded

§

MessagePaidMessagePriceChanged(MessagePaidMessagePriceChanged)

A price for paid messages was changed in the supergroup chat

§

MessageDirectMessagePriceChanged(MessageDirectMessagePriceChanged)

A price for direct messages was changed in the channel chat

§

MessageChecklistTasksDone(MessageChecklistTasksDone)

Some tasks from a checklist were marked as done or not done

§

MessageChecklistTasksAdded(MessageChecklistTasksAdded)

Some tasks were added to a checklist

§

MessageSuggestedPostApprovalFailed(MessageSuggestedPostApprovalFailed)

Approval of suggested post has failed, because the user which proposed the post had no enough funds

§

MessageSuggestedPostApproved(MessageSuggestedPostApproved)

A suggested post was approved

§

MessageSuggestedPostDeclined(MessageSuggestedPostDeclined)

A suggested post was declined

§

MessageSuggestedPostPaid(MessageSuggestedPostPaid)

A suggested post was published for getOption(“suggested_post_lifetime_min”) seconds and payment for the post was received

§

MessageSuggestedPostRefunded(MessageSuggestedPostRefunded)

A suggested post was refunded

§

MessageContactRegistered

A contact has registered with Telegram

§

MessageUsersShared(MessageUsersShared)

The current user shared users, which were requested by the bot

§

MessageChatShared(MessageChatShared)

The current user shared a chat, which was requested by the bot

§

MessageBotWriteAccessAllowed(MessageBotWriteAccessAllowed)

The user allowed the bot to send messages

§

MessageWebAppDataSent(MessageWebAppDataSent)

Data from a Web App has been sent to a bot

§

MessageWebAppDataReceived(MessageWebAppDataReceived)

Data from a Web App has been received; for bots only

§

MessagePassportDataSent(MessagePassportDataSent)

Telegram Passport data has been sent to a bot

§

MessagePassportDataReceived(MessagePassportDataReceived)

Telegram Passport data has been received; for bots only

§

MessageProximityAlertTriggered(MessageProximityAlertTriggered)

A user in the chat came within proximity alert range

§

MessageUnsupported

A message content that is not supported in the current TDLib version

Trait Implementations§

Source§

impl Clone for MessageContent

Source§

fn clone(&self) -> MessageContent

Returns a duplicate 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<'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 PartialEq for MessageContent

Source§

fn eq(&self, other: &MessageContent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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
Source§

impl StructuralPartialEq for MessageContent

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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