Table of Contents

Class PlayOptions

Namespace
Nyra.Entities
Assembly
Nyra.dll
public sealed record PlayOptions : IEquatable<PlayOptions>
Inheritance
PlayOptions
Implements
Inherited Members

Constructors

PlayOptions(TimeSpan?, TimeSpan?, bool, JsonElement?, string?)

public PlayOptions(TimeSpan? StartPosition = null, TimeSpan? EndTime = null, bool NoReplace = false, JsonElement? UserData = null, string? AudioTrackId = null)

Parameters

StartPosition TimeSpan?

Starts playback at the given position, null falls back to the track's own start offset (a timestamped link) or the beginning when it has none. Must not be negative and must come before the end time, every play entry point validates and throws up front.

EndTime TimeSpan?

Stops playback at the given position, null plays to the end. Must be greater than zero and after the start position, every play entry point validates and throws up front.

NoReplace bool

When true, does not replace a track that is already playing.

UserData JsonElement?

Client data the server attaches to the track and echoes back. Must be a JSON object when set. Lavalink rejects any other kind, so the play methods throw ArgumentException up front.

AudioTrackId string

Selects a dub or alternate audio track on sources that expose more than one. NodeLink only, not with PlayIdentifierAsync(string, PlayOptions?, CancellationToken), which is Lavalink only.

Properties

AudioTrackId

Selects a dub or alternate audio track on sources that expose more than one. NodeLink only, not with PlayIdentifierAsync(string, PlayOptions?, CancellationToken), which is Lavalink only.

public string? AudioTrackId { get; init; }

Property Value

string

EndTime

Stops playback at the given position, null plays to the end. Must be greater than zero and after the start position, every play entry point validates and throws up front.

public TimeSpan? EndTime { get; init; }

Property Value

TimeSpan?

NoReplace

When true, does not replace a track that is already playing.

public bool NoReplace { get; init; }

Property Value

bool

StartPosition

Starts playback at the given position, null falls back to the track's own start offset (a timestamped link) or the beginning when it has none. Must not be negative and must come before the end time, every play entry point validates and throws up front.

public TimeSpan? StartPosition { get; init; }

Property Value

TimeSpan?

UserData

Client data the server attaches to the track and echoes back. Must be a JSON object when set. Lavalink rejects any other kind, so the play methods throw ArgumentException up front.

public JsonElement? UserData { get; init; }

Property Value

JsonElement?

Methods

Equals(PlayOptions?)

Indicates whether both options select the same playback with the same raw client data.

public bool Equals(PlayOptions? other)

Parameters

other PlayOptions

The options to compare with.

Returns

bool

Whether the members match, the raw data compared by content.

GetHashCode()

Returns a hash of the comparable members, the raw data stays out of it.

public override int GetHashCode()

Returns

int

The hash code.