Enums

Gateway

class sonolink.NodeStatus[source]

Represents the connection status of a node.

Variables:
  • DISCONNECTED – The node is not connected to Lavalink.

  • CONNECTED – The node is connected to Lavalink.

  • CONNECTING – The node is in the process of connecting to Lavalink.

CONNECTED = 2
CONNECTING = 3
DISCONNECTED = 1
class sonolink.TrackEndReason[source]

Represents the reason field from a track-end event payload.

Variables:
  • FINISHED – The track finished playing.

  • LOAD_FAILED – The track failed to load.

  • STOPPED – The track was stopped.

  • REPLACED – The track was replaced.

  • CLEANUP – The track was cleaned up.

CLEANUP = 'cleanup'
FINISHED = 'finished'
LOAD_FAILED = 'loadFailed'
REPLACED = 'replaced'
STOPPED = 'stopped'
property can_start_next: bool

Whether the next track can start playing.

class sonolink.TrackExceptionSeverity[source]

Represents a TrackException’s error severity.

Variables:
  • COMMON – The cause is known and expected, indicates that there is nothing wrong with the library itself.

  • SUSPICIOUS – The cause might not be exactly known, but is possibly caused by outside factors. For example when an outside service responds in a format that we do not expect.

  • FAULT – The probable cause is an issue with the library or there is no way to tell what the cause might be. This is the default level and other levels are used in cases where the thrower has more in-depth knowledge about the error.

COMMON = 'common'
FAULT = 'fault'
SUSPICIOUS = 'suspicious'
class sonolink.QueueMode[source]

Enum representing the various modes on sonolink.Queue

Variables:
  • NORMAL – Normal queue mode. Tracks are played in the order they were added.

  • LOOP – Loop the current track indefinitely. The next track will not be played until the current track is stopped or replaced.

  • LOOP_ALL – Loop the entire queue indefinitely. Once the queue is empty, it will be refilled with the tracks in the history (if enabled) and playback will continue. If history is not enabled, the queue will simply start over with the original tracks.

LOOP = 'loop'
LOOP_ALL = 'loop_all'
NORMAL = 'normal'
class sonolink.AutoPlayMode[source]

Enum representing the autoplay behavior of the player.

Variables:
  • ENABLED – AutoPlay works fully autonomously and fills the auto_queue with recommended tracks. If a track is added to the player’s standard queue, AutoPlay will treat it as a priority.

  • PARTIAL – AutoPlay works autonomously but does not fill the auto_queue with recommended tracks.

  • DISABLED – AutoPlay is completely disabled and will not perform any automatic actions.

DISABLED = 'disabled'
ENABLED = 'enabled'
PARTIAL = 'partial'
class sonolink.InactivityMode[source]

Represents the mode used to determine if a player is inactive.

Variables:
  • ALL_BOTS – The player is considered inactive if no non-bot members are in the voice channel.

  • ONLY_SELF – The player is considered inactive only if it is the only member in the voice channel.

  • IGNORED_USERS – The player is considered inactive if none of the specified “Keep Alive” user IDs are in the voice channel.

ALL_BOTS = 1
IGNORED_USERS = 3
ONLY_SELF = 2
class sonolink.SearchProvider[source]

Enum representing search providers for AutoPlay.

Variables:
  • YOUTUBE – YouTube Radio (RD) mix based on a video identifier.

  • SPOTIFY – Spotify recommendations based on a track identifier.

  • DEEZER – Deezer track/artist radio based on an identifier.

DEEZER = 'dzrec:{identifier}'
SPOTIFY = 'sprec:{identifier}'
YOUTUBE = 'https://www.youtube.com/watch?v={identifier}&list=RD{identifier}'

Rest

class sonolink.ExceptionSeverity[source]

Exception severity type.

Variables:
  • COMMON – The cause is known and expected, indicates that there is nothing wrong with the library itself.

  • SUSPICIOUS – The cause might not be exactly known, but is possibly caused by outside factors.

  • FAULT – The probable cause is an issue with the library or there is no way to tell what the cause might be.

COMMON = 'common'
FAULT = 'fault'
SUSPICIOUS = 'suspicious'
class sonolink.TrackLoadResult[source]

Result type returned when loading tracks.

Each value represents the type of result returned in sonolink.rest.schemas.TrackLoadingResponse.load_type.

Variables:
  • TRACK – A single track was loaded

  • PLAYLIST – A playlist was loaded

  • SEARCH – Search results were returned

  • EMPTY – No matches for the identifier

  • ERROR – Loading failed

EMPTY = 'empty'
ERROR = 'error'
PLAYLIST = 'playlist'
SEARCH = 'search'
TRACK = 'track'
class sonolink.TrackSourceType[source]

A track source type. This can be used when searching using sonolink.Node.search_track() or sonolink.Client.search_track().

This provides the default track sources by Lavalink.

DEEZER = 'dzsearch'
SOUND_CLOUD = 'scsearch'
SPOTIFY = 'spsearch'
YOUTUBE = 'ytsearch'
YOUTUBE_MUSIC = 'ytmsearch'
class sonolink.RoutePlannerType[source]

IP route planner strategy used by Lavalink.

Determines how IP addresses are rotated or balanced to handle bans, load, and IPv6 blocks.

Variables:
  • ROTATING_IP – Switch IP on ban (IPv4 or small IPv6 ranges).

  • NANO_IP – Rotate periodically within a single /64 IPv6 block.

  • ROTATING_NANO_IP – Rotate periodically and switch /64 block on ban.

  • BALANCING_IP – Balance requests across multiple IP addresses.

BALANCING_IP = 'balancing_ip'
NANO_IP = 'nano_ip'
ROTATING_IP = 'rotating_ip'
ROTATING_NANO_IP = 'rotating_nano_ip'
class sonolink.IPBlockType[source]

IP block family type.

Variables:
  • IPV4 – IPv4 address block.

  • IPV6 – IPv6 address block.

IPV4 = 'inet4'
IPV6 = 'inet6'

Events

class sonolink.DisconnectTriggerType[source]

Enum representing what triggered a disconnect from a Player.

Variables:
  • MANUAL – The disconnect was triggered manually, usually by calling Player.disconnect().

  • INACTIVITY – The disconnect was triggered by the inactivity handler.

  • ERROR – The disconnect was triggered due to an error.

  • UNKNOWN – The disconnect was triggered by an unknown source.

ERROR = 3
INACTIVITY = 2
MANUAL = 1
UNKNOWN = 4