Skip to main content

Class MessageExtensions

Provides extension methods for Discord.IMessage.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public static class MessageExtensions

Methods​

GetJumpUrl(IMessage)​

Gets a URL that jumps to the message.

View Source​
Declaration
public static string GetJumpUrl(this IMessage msg)
Returns​

System.String: A string that contains a URL for jumping to the message in chat.

Parameters​
TypeNameDescription
Discord.IMessagemsgThe message to jump to.

AddReactionsAsync(IUserMessage, IEmote[], RequestOptions)​

Add multiple reactions to a message.

View Source​
Declaration
public static async Task AddReactionsAsync(this IUserMessage msg, IEmote[] reactions, 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.IUserMessagemsgThe message to add reactions to.
Discord.IEmote[]reactionsAn array of reactions to add to the message.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveReactionsAsync(IUserMessage, IUser, IEmote[], RequestOptions)​

Remove multiple reactions from a message.

View Source​
Declaration
public static async Task RemoveReactionsAsync(this IUserMessage msg, IUser user, IEmote[] reactions, 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.IUserMessagemsgThe message to remove reactions from.
Discord.IUseruserThe user who removed the reaction.
Discord.IEmote[]reactionsAn array of reactions to remove from the message.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ReplyAsync(IUserMessage, String, Boolean, Embed, AllowedMentions, RequestOptions, MessageComponent, ISticker[], Embed[])​

Sends an inline reply that references a message.

View Source​
Declaration
public static async Task<IUserMessage> ReplyAsync(this IUserMessage msg, string text = null, bool isTTS = false, Embed embed = null, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
Discord.IUserMessagemsgThe message that is being replied on.
System.StringtextThe message to be sent.
System.BooleanisTTSDetermines whether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.AllowedMentionsallowedMentions

Specifies if notifications are sent for mentioned users and roles in the message <code data-dev-comment-type="paramref" class="paramref">text</code>. If null, all mentioned roles and users will be notified. | | Discord.RequestOptions | options | The options to be used when sending the request. | | Discord.MessageComponent | components | The message components to be included with this message. Used for interactions. | | Discord.ISticker[] | stickers | A collection of stickers to send with the message. | | Discord.Embed[] | embeds | A array of Discord.Embeds to send with this response. Max 10. |