Interface IUserMessage
Represents a generic message sent by a user.
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public interface IUserMessage : IMessage, ISnowflakeEntity, IEntity<ulong>, IDeletable
Methods
| Improve this Doc View SourceModifyAsync(Action<MessageProperties>, RequestOptions)
Modifies this message.
Declaration
Task ModifyAsync(Action<MessageProperties> func, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<MessageProperties> | func | A delegate containing the properties to modify the message with. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous modification operation. |
Remarks
This method modifies this message with the specified properties. To see an example of this method and what properties are available, please refer to MessageProperties.
Examples
The following example replaces the content of the message with Hello World!.
await msg.ModifyAsync(x => x.Content = "Hello World!");
|
Improve this Doc
View Source
ModifySuppressionAsync(Boolean, RequestOptions)
Modifies the suppression of this message.
Declaration
Task ModifySuppressionAsync(bool suppressEmbeds, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | suppressEmbeds | Whether or not embeds in this message should be suppressed. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous modification operation. |
Remarks
This method modifies whether or not embeds in this message are suppressed (hidden).
PinAsync(RequestOptions)
Adds this message to its channel's pinned messages.
Declaration
Task PinAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| 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 pinning this message. |
Resolve(TagHandling, TagHandling, TagHandling, TagHandling, TagHandling)
Transforms this message's text into a human-readable form by resolving its tags.
Declaration
string Resolve(TagHandling userHandling = TagHandling.Name, TagHandling channelHandling = TagHandling.Name, TagHandling roleHandling = TagHandling.Name, TagHandling everyoneHandling = TagHandling.Ignore, TagHandling emojiHandling = TagHandling.Name)
Parameters
| Type | Name | Description |
|---|---|---|
| TagHandling | userHandling | Determines how the user tag should be handled. |
| TagHandling | channelHandling | Determines how the channel tag should be handled. |
| TagHandling | roleHandling | Determines how the role tag should be handled. |
| TagHandling | everyoneHandling | Determines how the @everyone tag should be handled. |
| TagHandling | emojiHandling | Determines how the emoji tag should be handled. |
Returns
| Type | Description |
|---|---|
| System.String |
UnpinAsync(RequestOptions)
Removes this message from its channel's pinned messages.
Declaration
Task UnpinAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| 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 unpinning this message. |