Class DiscordMessageData
Represents a discord Message Structure API model. Docs: https://discord.com/developers/docs/resources/channel#message-object-message-structure
Implements
Inherited Members
Namespace: Color_Chan.Discord.Core.Common.API.DataModels.Message
Assembly: Color-Chan.Discord.Core.dll
Syntax
public class DiscordMessageData : IEquatable<DiscordMessageData>
Properties
| Improve this Doc View SourceActivity
The activity data, Sent with Rich Presence-related chat embeds.
Declaration
[JsonPropertyName("activity")]
public DiscordMessageActivityData Activity { get; set; }
Property Value
Type | Description |
---|---|
DiscordMessageActivityData |
Application
The application data, sent with Rich Presence-related chat embeds.
Declaration
[JsonPropertyName("Application")]
public DiscordApplicationData Application { get; set; }
Property Value
Type | Description |
---|---|
DiscordApplicationData |
ApplicationId
If the message is a response to an Interaction, this is the id of the interaction's application.
Declaration
[JsonPropertyName("application_id")]
public ulong? ApplicationId { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
Attachments
Any attached files.
Declaration
[JsonPropertyName("attachments")]
public IEnumerable<DiscordAttachmentData> Attachments { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordAttachmentData> |
Author
The author of this message.
Declaration
[JsonPropertyName("author")]
public DiscordUserData Author { get; set; }
Property Value
Type | Description |
---|---|
DiscordUserData |
Remarks
Only available when the message is created by a user or a bot. Not when the message is create by a webhook.
ChannelId
Id of the channel the message was sent in.
Declaration
[JsonPropertyName("channel_id")]
public ulong? ChannelId { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
Components
Sent if the message contains components like buttons, action rows, or other interactive components.
Declaration
[JsonPropertyName("components")]
public IEnumerable<DiscordComponentData> Components { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordComponentData> |
Content
Contents of the message.
Declaration
[JsonPropertyName("content")]
public string Content { get; set; }
Property Value
Type | Description |
---|---|
String |
EditedTimestamp
When this message was edited (or null if never).
Declaration
[JsonPropertyName("edited_timestamp")]
public DateTimeOffset? EditedTimestamp { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<DateTimeOffset> |
Embeds
Any embedded content.
Declaration
[JsonPropertyName("embeds")]
public IEnumerable<DiscordEmbedData> Embeds { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordEmbedData> |
Flags
Message flags combined as a bitfield.
Declaration
[JsonPropertyName("lags")]
public DiscordMessageFlags? Flags { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<DiscordMessageFlags> |
GuildId
Id of the guild the message was sent in.
Declaration
[JsonPropertyName("guild_id")]
public ulong? GuildId { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
Id
The Discord provided snowflake id.
Declaration
[JsonPropertyName("id")]
public ulong Id { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Interaction
Sent if the message is a response to an Interaction.
Declaration
[JsonPropertyName("interaction")]
public DiscordInteractionData Interaction { get; set; }
Property Value
Type | Description |
---|---|
DiscordInteractionData |
IsPinned
Whether this message is pinned.
Declaration
[JsonPropertyName("pinned")]
public bool IsPinned { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsTts
Whether this was a TTS message.
Declaration
[JsonPropertyName("tts")]
public bool IsTts { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Member
Member properties for this message's author.
Declaration
[JsonPropertyName("member")]
public DiscordGuildMemberData Member { get; set; }
Property Value
Type | Description |
---|---|
DiscordGuildMemberData |
Remarks
The member object exists in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels, provided that the author of the message is not a webhook. This allows bots to obtain real-time member data without requiring bots to store member state in memory.
MentionEveryone
Whether this message mentions everyone.
Declaration
[JsonPropertyName("mention_everyone")]
public bool MentionEveryone { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Mentions
Users specifically mentioned in the message.
Declaration
[JsonPropertyName("mentions")]
public IEnumerable<DiscordUserData> Mentions { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordUserData> |
MentionsChannel
Channels specifically mentioned in this message.
Declaration
[JsonPropertyName("mention_channels")]
public IEnumerable<ulong> MentionsChannel { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.UInt64> |
MentionsRoles
Roles specifically mentioned in this message.
Declaration
[JsonPropertyName("mention_roles")]
public IEnumerable<ulong> MentionsRoles { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.UInt64> |
Nonce
Used for validating a message was sent.
Declaration
[JsonPropertyName("nonce")]
public string Nonce { get; set; }
Property Value
Type | Description |
---|---|
String |
Reactions
Reactions to the message.
Declaration
[JsonPropertyName("reactions")]
public IEnumerable<DiscordReactionData> Reactions { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordReactionData> |
ReferencedMessage
The message associated with ReferenceMessage.
Declaration
[JsonPropertyName("referenced_message")]
public DiscordMessageData ReferencedMessage { get; set; }
Property Value
Type | Description |
---|---|
DiscordMessageData |
Remarks
This field is only returned for messages with a type of 19 (REPLY) or 21 (THREAD_STARTER_MESSAGE). If the message is a reply but the referenced_message field is not present, the backend did not attempt to fetch the message that was being replied to, so its state is unknown. If the field exists but is null, the referenced message was deleted.
ReferenceMessage
Data showing the source of a cross post, channel follow add, pin, or reply message.
Declaration
[JsonPropertyName("message_reference")]
public DiscordMessageReferenceData ReferenceMessage { get; set; }
Property Value
Type | Description |
---|---|
DiscordMessageReferenceData |
StickerItems
Sent if the message contains stickers.
Declaration
[JsonPropertyName("sticker_items")]
public IEnumerable<DiscordMessageStickerItemData> StickerItems { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordMessageStickerItemData> |
Remarks
Bots cannot send stickers.
Stickers
the stickers sent with the message
Declaration
[Obsolete("Replaced with sticker_items")]
[JsonPropertyName("stickers")]
public IEnumerable<DiscordStickerData> Stickers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DiscordStickerData> |
Thread
The thread that was started from this message, includes thread member object.
Declaration
[JsonPropertyName("thread")]
public DiscordChannelData Thread { get; set; }
Property Value
Type | Description |
---|---|
DiscordChannelData |
Timestamp
When this message was sent.
Declaration
[JsonPropertyName("timestamp")]
public DateTimeOffset Timestamp { get; set; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
Type
Type of message.
Declaration
[JsonPropertyName("type")]
public DiscordMessageType Type { get; set; }
Property Value
Type | Description |
---|---|
DiscordMessageType |
WebhookId
If the message is generated by a webhook, this is the webhook's id.
Declaration
[JsonPropertyName("webhook_id")]
public ulong WebhookId { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |