Table of Contents

Class GatewayClientExtensions

Namespace
NetCord.Gateway.Voice
Assembly
NetCord.dll
public static class GatewayClientExtensions
Inheritance
GatewayClientExtensions
Inherited Members

Methods

JoinVoiceChannelAsync(GatewayClient, ulong, ulong, VoiceClientConfiguration?, TimeSpan?, TimeProvider?, CancellationToken)

Joins a voice channel.

public static Task<VoiceClient> JoinVoiceChannelAsync(this GatewayClient client, ulong guildId, ulong channelId, VoiceClientConfiguration? configuration = null, TimeSpan? timeout = null, TimeProvider? timeProvider = null, CancellationToken cancellationToken = default)

Parameters

client GatewayClient

The GatewayClient instance.

guildId ulong

The ID of the guild containing the channel.

channelId ulong

The ID of the voice channel to join.

configuration VoiceClientConfiguration

Configuration settings for the VoiceClient.

timeout TimeSpan?

The maximum amount of time to wait for the voice state and server update events. If not specified, a default timeout of 5 seconds is used.

timeProvider TimeProvider

The TimeProvider to use for measuring the timeout. If not specified, System is used.

cancellationToken CancellationToken

Cancellation token for the operation.

Returns

Task<VoiceClient>

A task, the result of which is an unconnected VoiceClient instance.

Remarks

This method is not thread safe and should not be used concurrently for the same guildId.