Class SocketVoiceChannel
Represents a WebSocket-based voice channel in a guild.
Implements
Inherited Members
Namespace: Discord.WebSocket
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketVoiceChannel : SocketGuildChannel, IVoiceChannel, INestedChannel, IGuildChannel, IDeletable, ISocketAudioChannel, 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. |
Category
Gets the parent (category) channel of this channel.
Declaration
public ICategoryChannel Category { get; }
Property Value
| Type | Description |
|---|---|
| ICategoryChannel | A category channel representing the parent of this channel; |
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; |
Users
Gets a collection of users that are able to view the channel.
Declaration
public override IReadOnlyCollection<SocketGuildUser> Users { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<SocketGuildUser> | A read-only collection of users that can access the channel (i.e. the users seen in the user list). |
Overrides
Methods
| Improve this Doc View SourceConnectAsync(Boolean, Boolean, Boolean)
Connects to this audio channel.
Declaration
public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false)
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. |
CreateInviteAsync(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. |
DisconnectAsync()
Disconnects from this audio channel.
Declaration
public Task DisconnectAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task representing the asynchronous operation for disconnecting from the audio 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. |
GetUser(UInt64)
Declaration
public override SocketGuildUser GetUser(ulong id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id |
Returns
| Type | Description |
|---|---|
| SocketGuildUser |
Overrides
| Improve this Doc View SourceModifyAsync(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 SourceIGuildChannel.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; |
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; |