Class SocketGroupChannel
Represents a WebSocket-based private group channel.
Assembly: Discord.Net.WebSocket.dll​
View Source​
public class SocketGroupChannel : SocketChannel, IGroupChannel, ISocketPrivateChannel, IPrivateChannel, ISocketMessageChannel, IMessageChannel, ISocketAudioChannel, IAudioChannel, IChannel, ISnowflakeEntity, IEntity<ulong>
Properties​
Name​
Gets the name of this channel.
View Source​
public string Name { get; }
CachedMessages​
Gets all messages in this channel's cache.
View Source​
public IReadOnlyCollection<SocketMessage> CachedMessages { get; }
Users​
Returns a collection representing all of the users in the group.
View Source​
public IReadOnlyCollection<SocketGroupUser> Users { get; }
Recipients​
Returns a collection representing all users in the group, not including the client.
View Source​
public IReadOnlyCollection<SocketGroupUser> Recipients { get; }
ISocketPrivateChannel.Recipients​
View Source​
IReadOnlyCollection<SocketUser> ISocketPrivateChannel.Recipients { get; }
IPrivateChannel.Recipients​
Gets the users that can access this channel.
View Source​
IReadOnlyCollection<IUser> IPrivateChannel.Recipients { get; }
Methods​
LeaveAsync(RequestOptions)​
Leaves this group.
View Source​
public Task LeaveAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous leave operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
ConnectAsync()​
View Source​
public Task<IAudioClient> ConnectAsync()
Returns​
System.Threading.Tasks.Task<Discord.Audio.IAudioClient>
GetCachedMessage(UInt64)​
Gets a cached message from this channel.
View Source​
public SocketMessage GetCachedMessage(ulong id)
Returns​
Discord.WebSocket.SocketMessage:
A WebSocket-based message object; null
if it does not exist in the cache or if caching is not
enabled.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the message. |
GetMessageAsync(UInt64, RequestOptions)​
Gets a message from this message channel.
View Source​
public async Task<IMessage> GetMessageAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.IMessage>
:
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the message. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetMessagesAsync(Int32, RequestOptions)​
Gets the last N messages from this message channel.
View Source​
public IAsyncEnumerable<IReadOnlyCollection<IMessage>> GetMessagesAsync(int limit = 100, RequestOptions options = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>
:
Paged collection of messages.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | limit | The numbers of message to be gotten from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetMessagesAsync(UInt64, Direction, Int32, RequestOptions)​
Gets a collection of messages in this channel.
View Source​
public IAsyncEnumerable<IReadOnlyCollection<IMessage>> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = 100, RequestOptions options = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>
:
Paged collection of messages.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | fromMessageId | The ID of the starting message to get the messages from. |
Discord.Direction | dir | The direction of the messages to be gotten from. |
System.Int32 | limit | The numbers of message to be gotten from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetMessagesAsync(IMessage, Direction, Int32, RequestOptions)​
Gets a collection of messages in this channel.
View Source​
public IAsyncEnumerable<IReadOnlyCollection<IMessage>> GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = 100, RequestOptions options = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>
:
Paged collection of messages.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IMessage | fromMessage | The starting message to get the messages from. |
Discord.Direction | dir | The direction of the messages to be gotten from. |
System.Int32 | limit | The numbers of message to be gotten from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetCachedMessages(Int32)​
Gets the last N cached messages from this message channel.
View Source​
public IReadOnlyCollection<SocketMessage> GetCachedMessages(int limit = 100)
Returns​
System.Collections.Generic.IReadOnlyCollection<Discord.WebSocket.SocketMessage>
:
A read-only collection of WebSocket-based messages.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | limit | The number of messages to get. |
GetCachedMessages(UInt64, Direction, Int32)​
Gets the last N cached messages starting from a certain message in this message channel.
View Source​
public IReadOnlyCollection<SocketMessage> GetCachedMessages(ulong fromMessageId, Direction dir, int limit = 100)
Returns​
System.Collections.Generic.IReadOnlyCollection<Discord.WebSocket.SocketMessage>
:
A read-only collection of WebSocket-based messages.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | fromMessageId | The message ID to start the fetching from. |
Discord.Direction | dir | The direction of which the message should be gotten from. |
System.Int32 | limit | The number of messages to get. |
GetCachedMessages(IMessage, Direction, Int32)​
Gets the last N cached messages starting from a certain message in this message channel.
View Source​
public IReadOnlyCollection<SocketMessage> GetCachedMessages(IMessage fromMessage, Direction dir, int limit = 100)
Returns​
System.Collections.Generic.IReadOnlyCollection<Discord.WebSocket.SocketMessage>
:
A read-only collection of WebSocket-based messages.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IMessage | fromMessage | The message to start the fetching from. |
Discord.Direction | dir | The direction of which the message should be gotten from. |
System.Int32 | limit | The number of messages to get. |
GetPinnedMessagesAsync(RequestOptions)​
Gets a read-only collection of pinned messages in this channel.
View Source​
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 read-only collection of messages found in the pinned messages.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
System.String | text | The message to be sent. |
System.Boolean | isTTS | Determines whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Discord.AllowedMentions | allowedMentions |
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​
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​
Type | Name | Description |
---|---|---|
System.String | filePath | The file path of the file. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
System.Boolean | isSpoiler | Whether the message attachment should be hidden as a spoiler. |
Discord.AllowedMentions | allowedMentions |
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 file. |
| 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​
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​
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream of the file to be sent. |
System.String | filename | The name of the attachment. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
System.Boolean | isSpoiler | Whether the message attachment should be hidden as a spoiler. |
Discord.AllowedMentions | allowedMentions |
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 file. |
| 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​
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​
Type | Name |
---|---|
Discord.FileAttachment | attachment |
System.String | text |
System.Boolean | isTTS |
Discord.Embed | embed |
Discord.RequestOptions | options |
Discord.AllowedMentions | allowedMentions |
Discord.MessageReference | messageReference |
Discord.MessageComponent | component |
Discord.ISticker[] | stickers |
Discord.Embed[] | embeds |
SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​
View Source​
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​
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<Discord.FileAttachment> | attachments |
System.String | text |
System.Boolean | isTTS |
Discord.Embed | embed |
Discord.RequestOptions | options |
Discord.AllowedMentions | allowedMentions |
Discord.MessageReference | messageReference |
Discord.MessageComponent | component |
Discord.ISticker[] | stickers |
Discord.Embed[] | embeds |
DeleteMessageAsync(UInt64, RequestOptions)​
Deletes a message.
View Source​
public Task DeleteMessageAsync(ulong messageId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | messageId | The snowflake identifier of the message that would be removed. |
Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteMessageAsync(IMessage, RequestOptions)​
Deletes a message based on the provided message in this channel.
View Source​
public Task DeleteMessageAsync(IMessage message, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IMessage | message | The message that would be removed. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyMessageAsync(UInt64, Action<MessageProperties>, RequestOptions)​
Modifies a message.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | messageId | The snowflake identifier of the message that would be changed. |
System.Action<Discord.MessageProperties> | func | A delegate containing the properties to modify the message with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
TriggerTypingAsync(RequestOptions)​
Broadcasts the "user is typing" message to all users in this channel, lasting 10 seconds.
View Source​
public Task TriggerTypingAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous operation that triggers the broadcast.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetUser(UInt64)​
Gets a user from this group.
View Source​
public SocketGroupUser GetUser(ulong id)
Returns​
Discord.WebSocket.SocketGroupUser: A WebSocket-based group user associated with the snowflake identifier.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user. |
ToString()​
Returns the name of the group.
View Source​
public override string ToString()
Returns​
System.String
IMessageChannel.GetMessageAsync(UInt64, CacheMode, RequestOptions)​
Gets a message from this message channel.
View Source​
async Task<IMessage> IMessageChannel.GetMessageAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IMessage>
:
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the message. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IMessageChannel.GetMessagesAsync(Int32, CacheMode, RequestOptions)​
Gets the last N messages from this message channel.
View Source​
IAsyncEnumerable<IReadOnlyCollection<IMessage>> IMessageChannel.GetMessagesAsync(int limit, CacheMode mode, RequestOptions options)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>
:
Paged collection of messages.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | limit | The numbers of message to be gotten from. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from |
cache. | ||
Discord.RequestOptions | options | The options to be used when sending the request. |
IMessageChannel.GetMessagesAsync(UInt64, Direction, Int32, CacheMode, RequestOptions)​
Gets a collection of messages in this channel.
View Source​
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>>
:
Paged collection of messages.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | fromMessageId | The ID of the starting message to get the messages from. |
Discord.Direction | dir | The direction of the messages to be gotten from. |
System.Int32 | limit | The numbers of message to be gotten from. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from |
cache. | ||
Discord.RequestOptions | options | The options to be used when sending the request. |
IMessageChannel.GetMessagesAsync(IMessage, Direction, Int32, CacheMode, RequestOptions)​
Gets a collection of messages in this channel.
View Source​
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>>
:
Paged collection of messages.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IMessage | fromMessage | The starting message to get the messages from. |
Discord.Direction | dir | The direction of the messages to be gotten from. |
System.Int32 | limit | The numbers of message to be gotten from. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from |
cache. | ||
Discord.RequestOptions | options | The options to be used when sending the request. |
IMessageChannel.GetPinnedMessagesAsync(RequestOptions)​
Gets a collection of pinned messages in this channel.
View Source​
async Task<IReadOnlyCollection<IMessage>> IMessageChannel.GetPinnedMessagesAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IMessage>>
:
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IMessageChannel.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​
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>
:
A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message.
Parameters​
Type | Name | Description |
---|---|---|
System.String | filePath | The file path of the file. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
System.Boolean | isSpoiler | Whether the message attachment should be hidden as a spoiler. |
Discord.AllowedMentions | allowedMentions |
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 file. |
| Discord.Embed[]
| embeds | A array of Discord.Embeds to send with this response. Max 10. |
IMessageChannel.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​
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>
:
A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message.
Parameters​
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream of the file to be sent. |
System.String | filename | The name of the attachment. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
System.Boolean | isSpoiler | Whether the message attachment should be hidden as a spoiler. |
Discord.AllowedMentions | allowedMentions |
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 file. |
| Discord.Embed[]
| embeds | A array of Discord.Embeds to send with this response. Max 10. |
IMessageChannel.SendFileAsync(FileAttachment, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​
Sends a file to this message channel with an optional caption.
View Source​
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>
:
A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message.
Parameters​
Type | Name | Description |
---|---|---|
Discord.FileAttachment | attachment | The attachment containing the file and description. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Discord.AllowedMentions | allowedMentions |
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 file. |
| Discord.Embed[]
| embeds | A array of Discord.Embeds to send with this response. Max 10. |
IMessageChannel.SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​
Sends a collection of files to this message channel.
View Source​
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>
:
A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.FileAttachment> | attachments | A collection of attachments to upload. |
System.String | text | The message to be sent. |
System.Boolean | isTTS | Whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Discord.AllowedMentions | allowedMentions |
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 file. |
| Discord.Embed[]
| embeds | A array of Discord.Embeds to send with this response. Max 10. |
IMessageChannel.SendMessageAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[])​
Sends a message to this message channel.
View Source​
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>
:
A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message.
Parameters​
Type | Name | Description |
---|---|---|
System.String | text | The message to be sent. |
System.Boolean | isTTS | Determines whether the message should be read aloud by Discord or not. |
Discord.Embed | embed | The Discord.EmbedType.Rich Discord.Embed to be sent. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Discord.AllowedMentions | allowedMentions |
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. |
IAudioChannel.ConnectAsync(Boolean, Boolean, Boolean)​
Connects to this audio channel.
View Source​
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​
Type | Name | Description |
---|---|---|
System.Boolean | selfDeaf | Determines whether the client should deaf itself upon connection. |
System.Boolean | selfMute | Determines whether the client should mute itself upon connection. |
System.Boolean | external | Determines whether the audio client is an external one or not. |
IAudioChannel.DisconnectAsync()​
View Source​
Task IAudioChannel.DisconnectAsync()
Returns​
System.Threading.Tasks.Task
IChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user in this channel.
View Source​
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IUser>
:
A task that represents the asynchronous get operation. The task result contains a user object that
represents the found user; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user (e.g. 168693960628371456 ). |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IChannel.GetUsersAsync(CacheMode, RequestOptions)​
Gets a collection of users that are able to view the channel or are currently in this channel.
View Source​
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IUser>>
:
Paged collection of users.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |