Class MessageExtensions
Provides extension methods for IMessage.
Inheritance
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public static class MessageExtensions
Methods
| Improve this Doc View SourceAddReactionsAsync(IUserMessage, IEmote[], RequestOptions)
Add multiple reactions to a message.
Declaration
public static Task AddReactionsAsync(this IUserMessage msg, IEmote[] reactions, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IUserMessage | msg | The message to add reactions to. |
| IEmote[] | reactions | An array of reactions to add to the message |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous operation for adding a reaction to this message. |
Remarks
This method does not bulk add reactions! It will send a request for each reaction inculded.
Examples
IEmote A = new Emoji("🅰");
IEmote B = new Emoji("🅱");
await msg.AddReactionsAsync(new[] { A, B });
See Also
| Improve this Doc View SourceGetJumpUrl(IMessage)
Gets a URL that jumps to the message.
Declaration
public static string GetJumpUrl(this IMessage msg)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessage | msg | The message to jump to. |
Returns
| Type | Description |
|---|---|
| System.String | A string that contains a URL for jumping to the message in chat. |
RemoveReactionsAsync(IUserMessage, IUser, IEmote[], RequestOptions)
Remove multiple reactions from a message.
Declaration
public static Task RemoveReactionsAsync(this IUserMessage msg, IUser user, IEmote[] reactions, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IUserMessage | msg | The message to remove reactions from. |
| IUser | user | |
| IEmote[] | reactions | An array of reactions to remove from the message |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous operation for removing a reaction to this message. |
Remarks
This method does not bulk remove reactions! If you want to clear reactions from a message,
Examples
await msg.RemoveReactionsAsync(currentUser, new[] { A, B });