Skip to main content

Interface IMessage

Represents a message object.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public interface IMessage : ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

Type​

Gets the type of this message.

View Source​
Declaration
MessageType Type { get; }

Source​

Gets the source type of this message.

View Source​
Declaration
MessageSource Source { get; }

IsTTS​

Gets the value that indicates whether this message was meant to be read-aloud by Discord.

View Source​
Declaration
bool IsTTS { get; }

IsPinned​

Gets the value that indicates whether this message is pinned.

View Source​
Declaration
bool IsPinned { get; }

IsSuppressed​

Gets the value that indicates whether or not this message's embeds are suppressed.

View Source​
Declaration
bool IsSuppressed { get; }

MentionedEveryone​

Gets the value that indicates whether this message mentioned everyone.

View Source​
Declaration
bool MentionedEveryone { get; }

Content​

Gets the content for this message.

View Source​
Declaration
string Content { get; }

CleanContent​

Gets the clean content for this message.

View Source​
Declaration
string CleanContent { get; }

Timestamp​

Gets the time this message was sent.

View Source​
Declaration
DateTimeOffset Timestamp { get; }

EditedTimestamp​

Gets the time of this message's last edit.

View Source​
Declaration
DateTimeOffset? EditedTimestamp { get; }

Channel​

Gets the source channel of the message.

View Source​
Declaration
IMessageChannel Channel { get; }

Author​

Gets the author of this message.

View Source​
Declaration
IUser Author { get; }

Attachments​

Gets all attachments included in this message.

View Source​
Declaration
IReadOnlyCollection<IAttachment> Attachments { get; }

Embeds​

Gets all embeds included in this message.

View Source​
Declaration
IReadOnlyCollection<IEmbed> Embeds { get; }

Tags​

Gets all tags included in this message's content.

View Source​
Declaration
IReadOnlyCollection<ITag> Tags { get; }

MentionedChannelIds​

Gets the IDs of channels mentioned in this message.

View Source​
Declaration
IReadOnlyCollection<ulong> MentionedChannelIds { get; }

MentionedRoleIds​

Gets the IDs of roles mentioned in this message.

View Source​
Declaration
IReadOnlyCollection<ulong> MentionedRoleIds { get; }

MentionedUserIds​

Gets the IDs of users mentioned in this message.

View Source​
Declaration
IReadOnlyCollection<ulong> MentionedUserIds { get; }

Activity​

Gets the activity associated with a message.

View Source​
Declaration
MessageActivity Activity { get; }

Application​

Gets the application associated with a message.

View Source​
Declaration
MessageApplication Application { get; }

Reference​

Gets the reference to the original message if it is a crosspost, channel follow add, pin, or reply message.

View Source​
Declaration
MessageReference Reference { get; }

Reactions​

Gets all reactions included in this message.

View Source​
Declaration
IReadOnlyDictionary<IEmote, ReactionMetadata> Reactions { get; }

Components​

The Discord.IMessageComponent's attached to this message

View Source​
Declaration
IReadOnlyCollection<IMessageComponent> Components { get; }

Stickers​

Gets all stickers items included in this message.

View Source​
Declaration
IReadOnlyCollection<IStickerItem> Stickers { get; }

Flags​

Gets the flags related to this message.

View Source​
Declaration
MessageFlags? Flags { get; }

Interaction​

Gets the interaction this message is a response to.

View Source​
Declaration
IMessageInteraction Interaction { get; }

Methods​

AddReactionAsync(IEmote, RequestOptions)​

Adds a reaction to this message.

View Source​
Declaration
Task AddReactionAsync(IEmote emote, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for adding a reaction to this message.

Parameters​
TypeNameDescription
Discord.IEmoteemoteThe emoji used to react to this message.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveReactionAsync(IEmote, IUser, RequestOptions)​

Removes a reaction from message.

View Source​
Declaration
Task RemoveReactionAsync(IEmote emote, IUser user, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for removing a reaction to this message.

Parameters​
TypeNameDescription
Discord.IEmoteemoteThe emoji used to react to this message.
Discord.IUseruserThe user that added the emoji.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveReactionAsync(IEmote, UInt64, RequestOptions)​

Removes a reaction from message.

View Source​
Declaration
Task RemoveReactionAsync(IEmote emote, ulong userId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for removing a reaction to this message.

Parameters​
TypeNameDescription
Discord.IEmoteemoteThe emoji used to react to this message.
System.UInt64userIdThe ID of the user that added the emoji.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveAllReactionsAsync(RequestOptions)​

Removes all reactions from this message.

View Source​
Declaration
Task RemoveAllReactionsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveAllReactionsForEmoteAsync(IEmote, RequestOptions)​

Removes all reactions with a specific emoji from this message.

View Source​
Declaration
Task RemoveAllReactionsForEmoteAsync(IEmote emote, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
Discord.IEmoteemoteThe emoji used to react to this message.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetReactionUsersAsync(IEmote, Int32, RequestOptions)​

Gets all users that reacted to a message with a given emote.

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IUser>> GetReactionUsersAsync(IEmote emoji, int limit, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IUser>>: Paged collection of users.

Parameters​
TypeNameDescription
Discord.IEmoteemojiThe emoji that represents the reaction that you wish to get.
System.Int32limitThe number of users to request.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Extension Methods​