Events

Track

Track Start

Called when a track starts playing.

Parameters

player: sonolink.Player

The player that is playing the track.

payload: sonolink.gateway.TrackStartEvent

The event payload containing information about the track that started playing.

class sonolink.gateway.TrackStartEvent[source]
Attributes

Represents a track start event.

property node: Node

The node that received the event.

track

The track that started playing.

Track End

Called when a track ends.

Parameters

player: sonolink.Player

The player that was playing the track.

payload: sonolink.gateway.TrackEndEvent

The event payload containing information about the track that finished playing and the reason it ended.

class sonolink.gateway.TrackEndEvent[source]
Attributes

Represents a track end event.

property node: Node

The node that received the event.

reason: TrackEndReason

The reason the track ended.

track

The track that ended playing.

Track Exception

Called when an exception occurs while playing a track.

Parameters

player: sonolink.Player

The player that was playing the track.

payload: sonolink.gateway.TrackExceptionEvent

The event payload containing information about the track that caused the exception and the exception.

class sonolink.gateway.TrackExceptionEvent[source]
Attributes

Represents a track exception event.

exception: events.TrackException

The occurred exception.

property node: Node

The node that received the event.

track

The track that thew the exception.

Track Stuck

Called when a track gets stuck while playing.

Parameters

player: sonolink.Player

The player that was playing the track.

payload: sonolink.gateway.TrackStuckEvent

The event payload containing information about the track that got stuck and the threshold that was exceeded.

class sonolink.gateway.TrackStuckEvent[source]
Attributes

Represents a track stuck event.

property node: Node

The node that received the event.

threshold: int

The threshold in milliseconds that was exceeded.

track

The track that got stuck.

Node

Node Ready

Called when a node is ready.

Parameters

payload: sonolink.gateway.ReadyEvent

The event payload containing information about the node that is ready.

class sonolink.gateway.ReadyEvent[source]
Attributes

Represents a ready event.

property node: Node

The node that received the event.

resumed: bool

Whether the session was resumed, if this is False it implies a new connection was created.

session_id: str

The secret session ID.

Node Close

Called when a node is closed.

Parameters

node: sonolink.Node

The node that was closed.

Player

Player Update

Called when a player is updated.

Parameters

player: sonolink.Player

The player that was updated.

payload: sonolink.gateway.PlayerUpdateEvent

The event payload containing information about the player’s current state.

class sonolink.gateway.PlayerUpdateEvent[source]
Attributes

Represents a player_update event.

guild_id: int

The guild ID of the player.

property node: Node

The node that received the event.

state: receive.PlayerState

The state of the player.

Miscellaneous

Unknown Event

Called when an unknown event is received. This can be from plugins/extensions on Lavalink.

Parameters

player: sonolink.Player

The player that received the unknown event.

payload: dict

The raw event payload that was received.