Show / Hide Table of Contents

Class Message

Represents a message of any type

Inheritance
System.Object
Message
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TelegramBotApi.Types
Assembly: TelegramBotApi.dll
Syntax
[JsonObject(MemberSerialization = MemberSerialization.OptIn, ItemNullValueHandling = NullValueHandling.Ignore)]
public class Message

Properties

| Improve this Doc View Source

Animation

Information about the animation, if this is one

Declaration
[JsonProperty(PropertyName = "animation")]
public Animation Animation { get; set; }
Property Value
Type Description
Animation
| Improve this Doc View Source

Audio

Information about the audio file, if this is one

Declaration
[JsonProperty(PropertyName = "audio")]
public Audio Audio { get; set; }
Property Value
Type Description
Audio
| Improve this Doc View Source

AuthorSignature

Signature of the post author for messages in channels

Declaration
[JsonProperty(PropertyName = "author_signature")]
public string AuthorSignature { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Caption

Caption of the media message, if this is one

Declaration
[JsonProperty(PropertyName = "caption")]
public string Caption { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

CaptionEntities

Special entities like bot commands, mentions, links etc. in the caption of a media message

Declaration
public MessageEntity[] CaptionEntities { get; set; }
Property Value
Type Description
MessageEntity[]
| Improve this Doc View Source

ChannelChatCreated

Service message that a channel has been created. Can only be found in ReplyToMessage.

Declaration
[JsonProperty(PropertyName = "channel_chat_created")]
public bool ChannelChatCreated { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Chat

The chat this message was sent in

Declaration
[JsonProperty(PropertyName = "chat")]
public Chat Chat { get; set; }
Property Value
Type Description
Chat
| Improve this Doc View Source

ConnectedWebsite

The domain name of the website the user has logged in to using Telegram Login, if any

Declaration
[JsonProperty(PropertyName = "connected_website")]
public string ConnectedWebsite { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Contact

Information about the contact, if this is one

Declaration
[JsonProperty(PropertyName = "contact")]
public Contact Contact { get; set; }
Property Value
Type Description
Contact
| Improve this Doc View Source

Date

The exact time this message was sent

Declaration
public DateTime Date { get; set; }
Property Value
Type Description
System.DateTime
| Improve this Doc View Source

DeleteChatPhoto

True if this is a service message saying the chat photo has been deleted

Declaration
[JsonProperty(PropertyName = "delete_chat_photo")]
public bool DeleteChatPhoto { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Document

Information about the general file, if this is one

Declaration
[JsonProperty(PropertyName = "document")]
public Document Document { get; set; }
Property Value
Type Description
Document
| Improve this Doc View Source

EditDate

Date and time this message was last edited.

Declaration
public DateTime EditDate { get; set; }
Property Value
Type Description
System.DateTime
| Improve this Doc View Source

Entities

Special entities like bot commands, mentions, links etc.

Declaration
public MessageEntity[] Entities { get; set; }
Property Value
Type Description
MessageEntity[]
| Improve this Doc View Source

ForwardDate

For forwarded messages, the date and time the original message was sent

Declaration
public DateTime ForwardDate { get; set; }
Property Value
Type Description
System.DateTime
| Improve this Doc View Source

ForwardFrom

The user this message was forwarded from, if any

Declaration
[JsonProperty(PropertyName = "forward_from")]
public User ForwardFrom { get; set; }
Property Value
Type Description
User
| Improve this Doc View Source

ForwardFromChat

Info about the channel this message was forwarded from, if any

Declaration
[JsonProperty(PropertyName = "forward_from_chat")]
public Chat ForwardFromChat { get; set; }
Property Value
Type Description
Chat
| Improve this Doc View Source

ForwardFromMessageId

The message id of the original message, if forwarded from a channel

Declaration
[JsonProperty(PropertyName = "forward_from_message_id")]
public int ForwardFromMessageId { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ForwardSignature

The signature of the post author for messages forwarded from channels, if present

Declaration
[JsonProperty(PropertyName = "forward_signature")]
public string ForwardSignature { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

From

The user who sent this message. Empty for messages in channels.

Declaration
[JsonProperty(PropertyName = "from")]
public User From { get; set; }
Property Value
Type Description
User
| Improve this Doc View Source

Game

Information about the game, if this is a game message

Declaration
[JsonProperty(PropertyName = "game")]
public Game Game { get; set; }
Property Value
Type Description
Game
| Improve this Doc View Source

GroupChatCreated

True if this is a service message saying this group has been created

Declaration
[JsonProperty(PropertyName = "group_chat_created")]
public bool GroupChatCreated { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Invoice

Information about this invoice for payment, if this is one

Declaration
[JsonProperty(PropertyName = "invoice")]
public Invoice Invoice { get; set; }
Property Value
Type Description
Invoice
| Improve this Doc View Source

LeftChatMember

Information about a member that was removed from the group, if any

Declaration
[JsonProperty(PropertyName = "left_chat_member")]
public User LeftChatMember { get; set; }
Property Value
Type Description
User
| Improve this Doc View Source

Location

Information about the location, if this is one

Declaration
[JsonProperty(PropertyName = "location")]
public Location Location { get; set; }
Property Value
Type Description
Location
| Improve this Doc View Source

MediaGroupId

The unique identifier of a media message group this message belongs to, if any

Declaration
[JsonProperty(PropertyName = "media_group_id")]
public string MediaGroupId { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MessageId

Unique identifier of the message inside its chat

Declaration
[JsonProperty(PropertyName = "message_id")]
public int MessageId { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

MigrateFromChatId

If this is present, this supergroup has been migrated from a group with the specified identifier.

Declaration
[JsonProperty(PropertyName = "migrate_from_chat_id")]
public long MigrateFromChatId { get; set; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

MigrateToChatId

If this is present, this group has been migrated to a supergroup with the specified identifier.

Declaration
[JsonProperty(PropertyName = "migrate_to_chat_id")]
public long MigrateToChatId { get; set; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

NewChatMembers

New member(s) added to the (super)group and information about them (the bot itself might be one of them), if any

Declaration
[JsonProperty(PropertyName = "new_chat_members")]
public User[] NewChatMembers { get; set; }
Property Value
Type Description
User[]
| Improve this Doc View Source

NewChatPhoto

Different sizes of the new chat photo, if it has been changed

Declaration
[JsonProperty(PropertyName = "new_chat_photo")]
public PhotoSize[] NewChatPhoto { get; set; }
Property Value
Type Description
PhotoSize[]
| Improve this Doc View Source

NewChatTitle

The new chat title, if it has been changed

Declaration
[JsonProperty(PropertyName = "new_chat_title")]
public string NewChatTitle { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

PassportData

Optional. Telegram Passport data

Declaration
[JsonProperty(PropertyName = "passport_data")]
public PassportData PassportData { get; set; }
Property Value
Type Description
PassportData
| Improve this Doc View Source

Photo

Available sizes of the photo, if this is one

Declaration
[JsonProperty(PropertyName = "photo")]
public PhotoSize[] Photo { get; set; }
Property Value
Type Description
PhotoSize[]
| Improve this Doc View Source

PinnedMessage

Message that is pinned in this chat, if any. Will not contain a ReplyToMessage.

Declaration
[JsonProperty(PropertyName = "pinned_message")]
public Message PinnedMessage { get; set; }
Property Value
Type Description
Message
| Improve this Doc View Source

ReplyToMessage

The message this message is a reply to, if any. Not present if this already is a ReplyToMessage.

Declaration
[JsonProperty(PropertyName = "reply_to_message")]
public Message ReplyToMessage { get; set; }
Property Value
Type Description
Message
| Improve this Doc View Source

Sticker

Information about the sticker, if this is one

Declaration
[JsonProperty(PropertyName = "sticker")]
public Sticker Sticker { get; set; }
Property Value
Type Description
Sticker
| Improve this Doc View Source

SuccessfulPayment

Information about a successful payment, if this is a message about one

Declaration
[JsonProperty(PropertyName = "successful_payment")]
public SuccessfulPayment SuccessfulPayment { get; set; }
Property Value
Type Description
SuccessfulPayment
| Improve this Doc View Source

SupergroupChatCreated

Service message that a supergroup has been created. Can only be found in ReplyToMessage.

Declaration
[JsonProperty(PropertyName = "supergroup_chat_created")]
public bool SupergroupChatCreated { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Text

The text of the message, for text messages

Declaration
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Type

Type of this message

Declaration
public MessageType Type { get; }
Property Value
Type Description
MessageType
| Improve this Doc View Source

Venue

Information about the venue, if this is one

Declaration
[JsonProperty(PropertyName = "venue")]
public Venue Venue { get; set; }
Property Value
Type Description
Venue
| Improve this Doc View Source

Video

Information about the video, if this is one

Declaration
[JsonProperty(PropertyName = "video")]
public Video Video { get; set; }
Property Value
Type Description
Video
| Improve this Doc View Source

VideoNote

Information about the video note, if this is one

Declaration
[JsonProperty(PropertyName = "video_note")]
public VideoNote VideoNote { get; set; }
Property Value
Type Description
VideoNote
| Improve this Doc View Source

Voice

Information about the voice message, if this is one

Declaration
[JsonProperty(PropertyName = "voice")]
public Voice Voice { get; set; }
Property Value
Type Description
Voice

Extension Methods

FormattedTextExtraction.ExtractHTML(Message)
FormattedTextExtraction.ExtractMarkdown(Message)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX