Class GatewayClientExtensions
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
clientGatewayClientThe GatewayClient instance.
guildIdulongThe ID of the guild containing the channel.
channelIdulongThe ID of the voice channel to join.
configurationVoiceClientConfigurationConfiguration settings for the VoiceClient.
timeoutTimeSpan?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.
timeProviderTimeProviderThe TimeProvider to use for measuring the timeout. If not specified, System is used.
cancellationTokenCancellationTokenCancellation 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.