Class MessageExtensions
Provides extension methods for Discord.IMessage.
Assembly: Discord.Net.Core.dll​
View Source​
public static class MessageExtensions
Methods​
GetJumpUrl(IMessage)​
Gets a URL that jumps to the message.
View Source​
public static string GetJumpUrl(this IMessage msg)
Returns​
System.String
:
A string that contains a URL for jumping to the message in chat.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IMessage | msg | The message to jump to. |
AddReactionsAsync(IUserMessage, IEmote[], RequestOptions)​
Add multiple reactions to a message.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.IUserMessage | msg | The message to add reactions to. |
Discord.IEmote[] | reactions | An array of reactions to add to the message. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveReactionsAsync(IUserMessage, IUser, IEmote[], RequestOptions)​
Remove multiple reactions from a message.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.IUserMessage | msg | The message to remove reactions from. |
Discord.IUser | user | The user who removed the reaction. |
Discord.IEmote[] | reactions | An array of reactions to remove from the message. |
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
Discord.IUserMessage | msg | The message that is being replied on. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Determines whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.AllowedMentions | allowedMentions |
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. |