Class RestVoiceChannel
Represents a REST-based voice channel in a guild.
Implements
Inherited Members
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public class RestVoiceChannel : RestGuildChannel, IUpdateable, IVoiceChannel, INestedChannel, IGuildChannel, IDeletable, IRestAudioChannel, IAudioChannel, IChannel, ISnowflakeEntity, IEntity<ulong>
Properties
| Improve this Doc View SourceBitrate
Gets the bit-rate that the clients in this voice channel are requested to use.
Declaration
public int Bitrate { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | An System.Int32 representing the bit-rate (bps) that this voice channel defines and requests the client(s) to use. |
CategoryId
Gets the parent (category) ID of this channel in the guild's channel list.
Declaration
public ulong? CategoryId { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> | A System.UInt64 representing the snowflake identifier of the parent of this channel;
|
UserLimit
Gets the max number of users allowed to be connected to this channel at once.
Declaration
public int? UserLimit { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Int32> | An System.Int32 representing the maximum number of users that are allowed to be connected to this
channel at once; |
Methods
| Improve this Doc View SourceCreateInviteAsync(Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Creates a new invite to this channel.
Declaration
public Task<IInviteMetadata> CreateInviteAsync(int? maxAge, int? maxUses = default(int? ), bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Int32> | maxAge | The time (in seconds) until the invite expires. Set to |
| System.Nullable<System.Int32> | maxUses | The max amount of times this invite may be used. Set to |
| System.Boolean | isTemporary | If |
| System.Boolean | isUnique | If |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IInviteMetadata> | A task that represents the asynchronous invite creation operation. The task result contains an invite metadata object containing information for the created invite. |
GetCategoryAsync(RequestOptions)
Gets the parent (category) channel of this channel.
Declaration
public Task<ICategoryChannel> GetCategoryAsync(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<ICategoryChannel> | A task that represents the asynchronous get operation. The task result contains the category channel
representing the parent of this channel; |
GetInvitesAsync(RequestOptions)
Gets a collection of all invites to this channel.
Declaration
public Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(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<System.Collections.Generic.IReadOnlyCollection<IInviteMetadata>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata that are created for this channel. |
ModifyAsync(Action<VoiceChannelProperties>, RequestOptions)
Modifies this voice channel.
Declaration
public Task ModifyAsync(Action<VoiceChannelProperties> func, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<VoiceChannelProperties> | func | The properties to modify the channel 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. |
See Also
| Improve this Doc View SourceSyncPermissionsAsync(RequestOptions)
Syncs the permissions of this nested channel with its parent's.
Declaration
public Task SyncPermissionsAsync(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 syncing channel permissions with its parent's. |
Explicit Interface Implementations
| Improve this Doc View SourceIAudioChannel.ConnectAsync(Boolean, Boolean, Boolean)
Connects to this audio channel.
Declaration
Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external)
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. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IAudioClient> | A task representing the asynchronous connection operation. The task result contains the IAudioClient responsible for the connection. |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Connecting to a REST-based channel is not supported. |
IAudioChannel.DisconnectAsync()
Declaration
Task IAudioChannel.DisconnectAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
IGuildChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)
Gets a user in this channel.
Declaration
Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier of the user. |
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildUser> | A task representing the asynchronous get operation. The task result contains a guild user object that
represents the user; |
IGuildChannel.GetUsersAsync(CacheMode, RequestOptions)
Gets a collection of users that are able to view the channel or are currently in this channel.
Declaration
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<IGuildUser>> | Paged collection of users. |
Remarks
This method follows the same behavior as described in GetUsersAsync(CacheMode, RequestOptions). Please visit its documentation for more details on this method.
INestedChannel.GetCategoryAsync(CacheMode, RequestOptions)
Gets the parent (category) channel of this channel.
Declaration
Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ICategoryChannel> | A task that represents the asynchronous get operation. The task result contains the category channel
representing the parent of this channel; |