Interface IMessage
Represents a message object.
Assembly: Discord.Net.Core.dll​
View Source​
public interface IMessage : ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties​
Type​
Gets the type of this message.
View Source​
MessageType Type { get; }
Source​
Gets the source type of this message.
View Source​
MessageSource Source { get; }
IsTTS​
Gets the value that indicates whether this message was meant to be read-aloud by Discord.
View Source​
bool IsTTS { get; }
IsPinned​
Gets the value that indicates whether this message is pinned.
View Source​
bool IsPinned { get; }
IsSuppressed​
Gets the value that indicates whether or not this message's embeds are suppressed.
View Source​
bool IsSuppressed { get; }
MentionedEveryone​
Gets the value that indicates whether this message mentioned everyone.
View Source​
bool MentionedEveryone { get; }
Content​
Gets the content for this message.
View Source​
string Content { get; }
CleanContent​
Gets the clean content for this message.
View Source​
string CleanContent { get; }
Timestamp​
Gets the time this message was sent.
View Source​
DateTimeOffset Timestamp { get; }
EditedTimestamp​
Gets the time of this message's last edit.
View Source​
DateTimeOffset? EditedTimestamp { get; }
Channel​
Gets the source channel of the message.
View Source​
IMessageChannel Channel { get; }
Author​
Gets the author of this message.
View Source​
IUser Author { get; }
Attachments​
Gets all attachments included in this message.
View Source​
IReadOnlyCollection<IAttachment> Attachments { get; }
Embeds​
Gets all embeds included in this message.
View Source​
IReadOnlyCollection<IEmbed> Embeds { get; }
Tags​
Gets all tags included in this message's content.
View Source​
IReadOnlyCollection<ITag> Tags { get; }
MentionedChannelIds​
Gets the IDs of channels mentioned in this message.
View Source​
IReadOnlyCollection<ulong> MentionedChannelIds { get; }
MentionedRoleIds​
Gets the IDs of roles mentioned in this message.
View Source​
IReadOnlyCollection<ulong> MentionedRoleIds { get; }
MentionedUserIds​
Gets the IDs of users mentioned in this message.
View Source​
IReadOnlyCollection<ulong> MentionedUserIds { get; }
Activity​
Gets the activity associated with a message.
View Source​
MessageActivity Activity { get; }
Application​
Gets the application associated with a message.
View Source​
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​
MessageReference Reference { get; }
Reactions​
Gets all reactions included in this message.
View Source​
IReadOnlyDictionary<IEmote, ReactionMetadata> Reactions { get; }
Components​
The Discord.IMessageComponent's attached to this message
View Source​
IReadOnlyCollection<IMessageComponent> Components { get; }
Stickers​
Gets all stickers items included in this message.
View Source​
IReadOnlyCollection<IStickerItem> Stickers { get; }
Flags​
Gets the flags related to this message.
View Source​
MessageFlags? Flags { get; }
Interaction​
Gets the interaction this message is a response to.
View Source​
IMessageInteraction Interaction { get; }
Methods​
AddReactionAsync(IEmote, RequestOptions)​
Adds a reaction to this message.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.IEmote | emote | The emoji used to react to this message. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveReactionAsync(IEmote, IUser, RequestOptions)​
Removes a reaction from message.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.IEmote | emote | The emoji used to react to this message. |
Discord.IUser | user | The user that added the emoji. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveReactionAsync(IEmote, UInt64, RequestOptions)​
Removes a reaction from message.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.IEmote | emote | The emoji used to react to this message. |
System.UInt64 | userId | The ID of the user that added the emoji. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveAllReactionsAsync(RequestOptions)​
Removes all reactions from this message.
View Source​
Task RemoveAllReactionsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveAllReactionsForEmoteAsync(IEmote, RequestOptions)​
Removes all reactions with a specific emoji from this message.
View Source​
Task RemoveAllReactionsForEmoteAsync(IEmote emote, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IEmote | emote | The emoji used to react to this message. |
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
Discord.IEmote | emoji | The emoji that represents the reaction that you wish to get. |
System.Int32 | limit | The number of users to request. |
Discord.RequestOptions | options | The options to be used when sending the request. |