Class Message
Represents a message of any type
Inheritance
Inherited Members
Namespace: TelegramBotApi.Types
Assembly: TelegramBotApi.dll
Syntax
[JsonObject(MemberSerialization = MemberSerialization.OptIn, ItemNullValueHandling = NullValueHandling.Ignore)]
public class Message
Properties
| Improve this Doc View SourceAnimation
Information about the animation, if this is one
Declaration
[JsonProperty(PropertyName = "animation")]
public Animation Animation { get; set; }
Property Value
Type | Description |
---|---|
Animation |
Audio
Information about the audio file, if this is one
Declaration
[JsonProperty(PropertyName = "audio")]
public Audio Audio { get; set; }
Property Value
Type | Description |
---|---|
Audio |
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 |
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 |
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[] |
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 |
Chat
The chat this message was sent in
Declaration
[JsonProperty(PropertyName = "chat")]
public Chat Chat { get; set; }
Property Value
Type | Description |
---|---|
Chat |
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 |
Contact
Information about the contact, if this is one
Declaration
[JsonProperty(PropertyName = "contact")]
public Contact Contact { get; set; }
Property Value
Type | Description |
---|---|
Contact |
Date
The exact time this message was sent
Declaration
public DateTime Date { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
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 |
Document
Information about the general file, if this is one
Declaration
[JsonProperty(PropertyName = "document")]
public Document Document { get; set; }
Property Value
Type | Description |
---|---|
Document |
EditDate
Date and time this message was last edited.
Declaration
public DateTime EditDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Entities
Special entities like bot commands, mentions, links etc.
Declaration
public MessageEntity[] Entities { get; set; }
Property Value
Type | Description |
---|---|
MessageEntity[] |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Location
Information about the location, if this is one
Declaration
[JsonProperty(PropertyName = "location")]
public Location Location { get; set; }
Property Value
Type | Description |
---|---|
Location |
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 |
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 |
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 |
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 |
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[] |
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[] |
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 |
PassportData
Optional. Telegram Passport data
Declaration
[JsonProperty(PropertyName = "passport_data")]
public PassportData PassportData { get; set; }
Property Value
Type | Description |
---|---|
PassportData |
Photo
Available sizes of the photo, if this is one
Declaration
[JsonProperty(PropertyName = "photo")]
public PhotoSize[] Photo { get; set; }
Property Value
Type | Description |
---|---|
PhotoSize[] |
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 |
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 |
Sticker
Information about the sticker, if this is one
Declaration
[JsonProperty(PropertyName = "sticker")]
public Sticker Sticker { get; set; }
Property Value
Type | Description |
---|---|
Sticker |
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 |
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 |
Text
The text of the message, for text messages
Declaration
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Type
Type of this message
Declaration
public MessageType Type { get; }
Property Value
Type | Description |
---|---|
MessageType |
Venue
Information about the venue, if this is one
Declaration
[JsonProperty(PropertyName = "venue")]
public Venue Venue { get; set; }
Property Value
Type | Description |
---|---|
Venue |
Video
Information about the video, if this is one
Declaration
[JsonProperty(PropertyName = "video")]
public Video Video { get; set; }
Property Value
Type | Description |
---|---|
Video |
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 |
Voice
Information about the voice message, if this is one
Declaration
[JsonProperty(PropertyName = "voice")]
public Voice Voice { get; set; }
Property Value
Type | Description |
---|---|
Voice |