Skip to main content

Interface IUserMessage

Represents a generic message sent by a user.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public interface IUserMessage : IMessage, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

ReferencedMessage​

Gets the referenced message if it is a crosspost, channel follow add, pin, or reply message.

View Source​
Declaration
IUserMessage ReferencedMessage { get; }

Methods​

ModifyAsync(Action<MessageProperties>, RequestOptions)​

Modifies this message.

View Source​
Declaration
Task ModifyAsync(Action<MessageProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.MessageProperties>funcA delegate containing the properties to modify the message with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

PinAsync(RequestOptions)​

Adds this message to its channel's pinned messages.

View Source​
Declaration
Task PinAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for pinning this message.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

UnpinAsync(RequestOptions)​

Removes this message from its channel's pinned messages.

View Source​
Declaration
Task UnpinAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for unpinning this message.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CrosspostAsync(RequestOptions)​

Publishes (crossposts) this message.

View Source​
Declaration
Task CrosspostAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for publishing this message.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Resolve(TagHandling, TagHandling, TagHandling, TagHandling, TagHandling)​

Transforms this message's text into a human-readable form by resolving its tags.

View Source​
Declaration
string Resolve(TagHandling userHandling = TagHandling.Name, TagHandling channelHandling = TagHandling.Name, TagHandling roleHandling = TagHandling.Name, TagHandling everyoneHandling = TagHandling.Ignore, TagHandling emojiHandling = TagHandling.Name)
Returns​

System.String

Parameters​
TypeNameDescription
Discord.TagHandlinguserHandlingDetermines how the user tag should be handled.
Discord.TagHandlingchannelHandlingDetermines how the channel tag should be handled.
Discord.TagHandlingroleHandlingDetermines how the role tag should be handled.
Discord.TagHandlingeveryoneHandlingDetermines how the @everyone tag should be handled.
Discord.TagHandlingemojiHandlingDetermines how the emoji tag should be handled.

Extension Methods​

  • Discord.IUserMessage.Discord.Commands.MessageExtensions.HasCharPrefix(System.Char,System.Int32@)
  • Discord.IUserMessage.Discord.Commands.MessageExtensions.HasStringPrefix(System.String,System.Int32@,System.StringComparison)
  • Discord.IUserMessage.Discord.Commands.MessageExtensions.HasMentionPrefix(Discord.IUser,System.Int32@)
  • Discord.MessageExtensions.GetJumpUrl(Discord.IMessage)
  • Discord.IUserMessage.Discord.MessageExtensions.AddReactionsAsync(Discord.IEmote[],Discord.RequestOptions)
  • Discord.IUserMessage.Discord.MessageExtensions.RemoveReactionsAsync(Discord.IUser,Discord.IEmote[],Discord.RequestOptions)
  • Discord.IUserMessage.Discord.MessageExtensions.ReplyAsync(System.String,System.Boolean,Discord.Embed,Discord.AllowedMentions,Discord.RequestOptions,Discord.MessageComponent,Discord.ISticker[],Discord.Embed[])