Class MessageHelpers
Http methods for Message class.
public static class MessageHelpers
- Inheritance
-
objectMessageHelpers
Methods
AcknowledgeAsync(Message, MessageAckJson)
Acknowledge a message has been read for the current user.
public static Task AcknowledgeAsync(this Message message, MessageAckJson json)
Parameters
messageMessagejsonMessageAckJson
Returns
Remarks
User accounts only.
AddReactionAsync(Message, Emoji)
Add a reaction to a message.
public static Task AddReactionAsync(this Message message, Emoji emoji)
Parameters
Returns
Remarks
Requires ViewChannel and AddReactions in a guild channel.
AddReactionAsync(Message, string)
Add a reaction to a message.
public static Task AddReactionAsync(this Message message, string emoji)
Parameters
Returns
Remarks
Requires ViewChannel and AddReactions in a guild channel.
DeleteAsync(Message)
Delete a message in a channel.
public static Task DeleteAsync(this Message message)
Parameters
messageMessage
Returns
Remarks
Requires ViewChannel and ReadMessageHistory in a guild channel.
ManageMessages for other user message.
DeleteAttachmentAsync(Message, ulong)
Delete a attachment on a message.
public static Task DeleteAttachmentAsync(this Message message, ulong attachmentId)
Parameters
Returns
Remarks
Requires ViewChannel and ReadMessageHistory in a guild channel.
ForwardAsync(Message, Channel, MessageFlag, string?)
Forward a message to another channel.
public static Task<Message> ForwardAsync(this Message message, Channel channel, MessageFlag flags = MessageFlag.None, string? nonce = null)
Parameters
messageMessagechannelChannelflagsMessageFlagnoncestring
Returns
Remarks
Requires ViewChannel and SendMessages in a guild channel.
GetReactionsForEmojiAsync(Message, Emoji)
Get reaction users for a certain emoji on a message.
public static Task<IEnumerable<User>> GetReactionsForEmojiAsync(this Message message, Emoji emoji)
Parameters
Returns
Remarks
Requires ViewChannel and ReadMessageHistory in a guild channel.
GetReactionsForEmojiAsync(Message, string)
Get reaction users for a certain emoji on a message.
public static Task<IEnumerable<User>> GetReactionsForEmojiAsync(this Message message, string emoji)
Parameters
Returns
Remarks
Requires ViewChannel and ReadMessageHistory in a guild channel.
ModifyAsync(Message, string?, List<EmbedRequest>?, MessageReferenceRequest?, AllowedMentionsRequest?, MessageFlag, string?, ulong?, List<ulong>?, List<AttachmentRequest>?)
Modify your message in a channel
public static Task<Message> ModifyAsync(this Message message, string? content = null, List<EmbedRequest>? embeds = null, MessageReferenceRequest? reference = null, AllowedMentionsRequest? allowedMentions = null, MessageFlag flags = MessageFlag.None, string? nonce = null, ulong? favoriteMediaId = null, List<ulong>? stickerIds = null, List<AttachmentRequest>? attachments = null)
Parameters
messageMessagecontentstringembedsList<EmbedRequest>referenceMessageReferenceRequestallowedMentionsAllowedMentionsRequestflagsMessageFlagnoncestringfavoriteMediaIdulong?stickerIdsList<ulong>attachmentsList<AttachmentRequest>
Returns
Remarks
Requires ViewChannel and ReadMessageHistory in a guild channel.
PinAsync(Message)
Pin a message in a channel.
public static Task PinAsync(this Message message)
Parameters
messageMessage
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and PinMessages in a guild channel.
RemoveAllReactionsAsync(Message)
Remove all reactions on a message.
public static Task RemoveAllReactionsAsync(this Message message)
Parameters
messageMessage
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and ManageMessages in a guild channel.
RemoveAllReactionsForEmojiAsync(Message, Emoji)
Remove all reactions for a specific emoji on a message.
public static Task RemoveAllReactionsForEmojiAsync(this Message message, Emoji emoji)
Parameters
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and ManageMessages in a guild channel.
RemoveAllReactionsForEmojiAsync(Message, string)
Remove all reactions for a specific emoji on a message.
public static Task RemoveAllReactionsForEmojiAsync(this Message message, string emoji)
Parameters
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and ManageMessages in a guild channel.
RemoveOwnReactionAsync(Message, Emoji)
Remove a reaction on a message.
public static Task RemoveOwnReactionAsync(this Message message, Emoji emoji)
Parameters
Returns
Remarks
Requires ViewChannel in a guild channel.
RemoveOwnReactionAsync(Message, string)
Remove a reaction on a message.
public static Task RemoveOwnReactionAsync(this Message message, string emoji)
Parameters
Returns
Remarks
Requires ViewChannel in a guild channel.
RemoveUserReactionAsync(Message, Emoji, User)
Remove a user's reaction on a message.
public static Task RemoveUserReactionAsync(this Message message, Emoji emoji, User user)
Parameters
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and ManageMessages in a guild channel.
RemoveUserReactionAsync(Message, string, ulong)
Remove a user's reaction on a message.
public static Task RemoveUserReactionAsync(this Message message, string emoji, ulong userId)
Parameters
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and ManageMessages in a guild channel.
ReplyAsync(Message, string?, List<EmbedRequest>?, AllowedMentionsRequest?, MessageFlag, string?, ulong?, bool?, List<ulong>?, List<AttachmentRequest>?)
Send a message in the channel.
public static Task<Message> ReplyAsync(this Message message, string? content = null, List<EmbedRequest>? embeds = null, AllowedMentionsRequest? allowedMentions = null, MessageFlag flags = MessageFlag.None, string? nonce = null, ulong? favoriteMediaId = null, bool? tts = null, List<ulong>? stickerIds = null, List<AttachmentRequest>? attachments = null)
Parameters
messageMessagecontentstringembedsList<EmbedRequest>allowedMentionsAllowedMentionsRequestflagsMessageFlagnoncestringfavoriteMediaIdulong?ttsbool?stickerIdsList<ulong>attachmentsList<AttachmentRequest>
Returns
Remarks
Requires ViewChannel and SendMessages for guild channels.
SuppressEmbedsAsync(Message)
Hide embeds on a message.
public static Task<Message> SuppressEmbedsAsync(this Message message)
Parameters
messageMessage
Returns
Remarks
Requires ViewChannel and ReadMessageHistory in a guild channel.
UnPinAsync(Message)
Remove a pinned message in a channel.
public static Task UnPinAsync(this Message message)
Parameters
messageMessage
Returns
Remarks
Requires ViewChannel, ReadMessageHistory and PinMessages in a guild channel.