Skip to main content

Class RestGroupChannel

Represents a REST-based group-message channel.

Assembly: Discord.Net.Rest.dll​
View Source​
Declaration
public class RestGroupChannel : RestChannel, IUpdateable, IGroupChannel, IRestPrivateChannel, IPrivateChannel, IRestMessageChannel, IMessageChannel, IRestAudioChannel, IAudioChannel, IChannel, ISnowflakeEntity, IEntity<ulong>

Properties​

Name​

Gets the name of this channel.

View Source​
Declaration
public string Name { get; }

Users​

View Source​
Declaration
public IReadOnlyCollection<RestGroupUser> Users { get; }

Recipients​

View Source​
Declaration
public IReadOnlyCollection<RestGroupUser> Recipients { get; }

IRestPrivateChannel.Recipients​

View Source​
Declaration
IReadOnlyCollection<RestUser> IRestPrivateChannel.Recipients { get; }

IPrivateChannel.Recipients​

View Source​
Declaration
IReadOnlyCollection<IUser> IPrivateChannel.Recipients { get; }

Methods​

UpdateAsync(RequestOptions)​

Updates this object's properties with its current state.

View Source​
Declaration
public override async Task UpdateAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

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

LeaveAsync(RequestOptions)​

Leaves this group.

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

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

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

GetUser(UInt64)​

View Source​
Declaration
public RestUser GetUser(ulong id)
Returns​

Discord.Rest.RestUser

Parameters​
TypeName
System.UInt64id

GetMessageAsync(UInt64, RequestOptions)​

Gets a message from this message channel.

View Source​
Declaration
public Task<RestMessage> GetMessageAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestMessage>: A task that represents an asynchronous get operation for retrieving the message. The task result contains the retrieved message; null if no message is found with the specified identifier.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the message.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessagesAsync(Int32, RequestOptions)​

Gets the last N messages from this message channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(int limit = 100, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
System.Int32limitThe numbers of message to be gotten from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessagesAsync(UInt64, Direction, Int32, RequestOptions)​

Gets a collection of messages in this channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = 100, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
System.UInt64fromMessageIdThe ID of the starting message to get the messages from.
Discord.DirectiondirThe direction of the messages to be gotten from.
System.Int32limitThe numbers of message to be gotten from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetMessagesAsync(IMessage, Direction, Int32, RequestOptions)​

Gets a collection of messages in this channel.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = 100, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: Paged collection of messages.

Parameters​
TypeNameDescription
Discord.IMessagefromMessageThe starting message to get the messages from.
Discord.DirectiondirThe direction of the messages to be gotten from.
System.Int32limitThe numbers of message to be gotten from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetPinnedMessagesAsync(RequestOptions)​

Gets a collection of pinned messages in this channel.

View Source​
Declaration
public Task<IReadOnlyCollection<RestMessage>> GetPinnedMessagesAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestMessage>>: A task that represents the asynchronous get operation for retrieving pinned messages in this channel. The task result contains a collection of messages found in the pinned messages.

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

DeleteMessageAsync(UInt64, RequestOptions)​

Deletes a message.

View Source​
Declaration
public Task DeleteMessageAsync(ulong messageId, RequestOptions options = null)
Returns​

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

Parameters​
TypeNameDescription
System.UInt64messageIdThe snowflake identifier of the message that would be removed.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteMessageAsync(IMessage, RequestOptions)​

Deletes a message based on the provided message in this channel.

View Source​
Declaration
public Task DeleteMessageAsync(IMessage message, RequestOptions options = null)
Returns​

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

Parameters​
TypeNameDescription
Discord.IMessagemessageThe message that would be removed.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyMessageAsync(UInt64, Action<MessageProperties>, RequestOptions)​

Modifies a message.

View Source​
Declaration
public async Task<IUserMessage> ModifyMessageAsync(ulong messageId, Action<MessageProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.UInt64messageIdThe snowflake identifier of the message that would be changed.
System.Action<Discord.MessageProperties>funcA delegate containing the properties to modify the message with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

SendMessageAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a message to this message channel.

View Source​
Declaration
public Task<RestUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.StringtextThe message to be sent.
System.BooleanisTTSDetermines whether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
Discord.AllowedMentionsallowedMentions

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.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | 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. |

SendFileAsync(String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
public Task<RestUserMessage> SendFileAsync(string filePath, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.StringfilePathThe file path of the file.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.BooleanisSpoilerWhether the message attachment should be hidden as a spoiler.
Discord.AllowedMentionsallowedMentions

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.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | 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. |

SendFileAsync(Stream, String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

Sends a file to this message channel with an optional caption.

View Source​
Declaration
public Task<RestUserMessage> SendFileAsync(Stream stream, string filename, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>: A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

Parameters​
TypeNameDescription
System.IO.StreamstreamThe System.IO.Stream of the file to be sent.
System.StringfilenameThe name of the attachment.
System.StringtextThe message to be sent.
System.BooleanisTTSWhether the message should be read aloud by Discord or not.
Discord.EmbedembedThe Discord.EmbedType.Rich Discord.Embed to be sent.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.BooleanisSpoilerWhether the message attachment should be hidden as a spoiler.
Discord.AllowedMentionsallowedMentions

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.MessageReference | messageReference | The message references to be included. Used to reply to specific messages. | | Discord.MessageComponent | component | 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. |

SendFileAsync(FileAttachment, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
public Task<RestUserMessage> SendFileAsync(FileAttachment attachment, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>

Parameters​
TypeName
Discord.FileAttachmentattachment
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
public Task<RestUserMessage> SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUserMessage>

Parameters​
TypeName
System.Collections.Generic.IEnumerable<Discord.FileAttachment>attachments
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

TriggerTypingAsync(RequestOptions)​

Broadcasts the "user is typing" message to all users in this channel, lasting 10 seconds.

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

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

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

EnterTypingState(RequestOptions)​

Continuously broadcasts the "user is typing" message to all users in this channel until the returned object is disposed.

View Source​
Declaration
public IDisposable EnterTypingState(RequestOptions options = null)
Returns​

System.IDisposable: A disposable object that, upon its disposal, will stop the client from broadcasting its typing state in this channel.

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

ToString()​

View Source​
Declaration
public override string ToString()
Returns​

System.String

IMessageChannel.GetMessageAsync(UInt64, CacheMode, RequestOptions)​

View Source​
Declaration
async Task<IMessage> IMessageChannel.GetMessageAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IMessage>

Parameters​
TypeName
System.UInt64id
Discord.CacheModemode
Discord.RequestOptionsoptions

IMessageChannel.GetMessagesAsync(Int32, CacheMode, RequestOptions)​

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(int limit, CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>

Parameters​
TypeName
System.Int32limit
Discord.CacheModemode
Discord.RequestOptionsoptions

IMessageChannel.GetMessagesAsync(UInt64, Direction, Int32, CacheMode, RequestOptions)​

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(ulong fromMessageId, Direction dir, int limit, CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>

Parameters​
TypeName
System.UInt64fromMessageId
Discord.Directiondir
System.Int32limit
Discord.CacheModemode
Discord.RequestOptionsoptions

IMessageChannel.GetMessagesAsync(IMessage, Direction, Int32, CacheMode, RequestOptions)​

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(IMessage fromMessage, Direction dir, int limit, CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>

Parameters​
TypeName
Discord.IMessagefromMessage
Discord.Directiondir
System.Int32limit
Discord.CacheModemode
Discord.RequestOptionsoptions

IMessageChannel.GetPinnedMessagesAsync(RequestOptions)​

View Source​
Declaration
async Task<IReadOnlyCollection<IMessage>> IMessageChannel.GetPinnedMessagesAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>

Parameters​
TypeName
Discord.RequestOptionsoptions

IMessageChannel.SendFileAsync(String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFileAsync(string filePath, string text, bool isTTS, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>

Parameters​
TypeName
System.StringfilePath
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
System.BooleanisSpoiler
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

IMessageChannel.SendFileAsync(Stream, String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFileAsync(Stream stream, string filename, string text, bool isTTS, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>

Parameters​
TypeName
System.IO.Streamstream
System.Stringfilename
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
System.BooleanisSpoiler
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

IMessageChannel.SendFileAsync(FileAttachment, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFileAsync(FileAttachment attachment, string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>

Parameters​
TypeName
Discord.FileAttachmentattachment
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment> attachments, string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>

Parameters​
TypeName
System.Collections.Generic.IEnumerable<Discord.FileAttachment>attachments
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

IMessageChannel.SendMessageAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​

View Source​
Declaration
async Task<IUserMessage> IMessageChannel.SendMessageAsync(string text, bool isTTS, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageReference messageReference, MessageComponent component, ISticker[] stickers, Embed[] embeds)
Returns​

System.Threading.Tasks.Task<Discord.IUserMessage>

Parameters​
TypeName
System.Stringtext
System.BooleanisTTS
Discord.Embedembed
Discord.RequestOptionsoptions
Discord.AllowedMentionsallowedMentions
Discord.MessageReferencemessageReference
Discord.MessageComponentcomponent
Discord.ISticker[]stickers
Discord.Embed[]embeds

IAudioChannel.ConnectAsync(Boolean, Boolean, Boolean)​

Connects to this audio channel.

View Source​
Declaration
Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external)
Returns​

System.Threading.Tasks.Task<Discord.Audio.IAudioClient>: A task representing the asynchronous connection operation. The task result contains the Discord.Audio.IAudioClient responsible for the connection.

Parameters​
TypeNameDescription
System.BooleanselfDeafDetermines whether the client should deaf itself upon connection.
System.BooleanselfMuteDetermines whether the client should mute itself upon connection.
System.BooleanexternalDetermines whether the audio client is an external one or not.

IAudioChannel.DisconnectAsync()​

View Source​
Declaration
Task IAudioChannel.DisconnectAsync()
Returns​

System.Threading.Tasks.Task

IChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​

View Source​
Declaration
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IUser>

Parameters​
TypeName
System.UInt64id
Discord.CacheModemode
Discord.RequestOptionsoptions

IChannel.GetUsersAsync(CacheMode, RequestOptions)​

View Source​
Declaration
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IUser>>

Parameters​
TypeName
Discord.CacheModemode
Discord.RequestOptionsoptions

Implements​