Table of Contents

Class NodeExtensions

Namespace
Nyra.NetCord
Assembly
Nyra.NetCord.dll

Nyra entry points that need NetCord channel types.

public static class NodeExtensions
Inheritance
NodeExtensions
Inherited Members

Methods

ConnectAsync(Node, IVoiceGuildChannel, CancellationToken)

Creates the guild connection on the node and joins the bot to the voice channel.

public static Task<GuildConnection> ConnectAsync(this Node node, IVoiceGuildChannel channel, CancellationToken cancellationToken = default)

Parameters

node Node

The node to connect through.

channel IVoiceGuildChannel

The voice channel to join. A stage channel joins as audience.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<GuildConnection>

The guild connection of the join, the existing one when its registry entry is still live.

Remarks

A stage channel joins the bot as audience, Nyra sends no request to speak, so audio only reaches it once a stage moderator unsuppresses the bot. A join for a channel with a live connection returns that connection, one racing a disconnect takes over the dying connection and returns a fresh one.

Exceptions

ArgumentNullException

node or channel is null.

ArgumentOutOfRangeException

The channel's guild id or channel id is zero.

ObjectDisposedException

The node was disposed.

InvalidOperationException

The node is not started and ready yet, or the guild is already connected to another channel or through a different node, disconnect it before connecting again.

VoiceHandshakeException

The voice handshake of the join failed, see its message for the cause.

NodeUnreachableException

The node became unreachable between the handshake and the player registration.

TimeoutException

The node's REST endpoint did not answer the player registration within its bound.

RestException

The node rejected the player registration, see its message for the reply.

OperationCanceledException

The join was cancelled through the token.