Reference#

Pool#

Node#

Player#

class discord.ext.lava.Player(*, link: Link)#
property guild: Guild#
await connect(*, timeout: float | None = None, reconnect: bool | None = None, self_deaf: bool = False, self_mute: bool = False) None#

|coro|

An abstract method called when the client initiates the connection request.

When a connection is requested initially, the library calls the constructor under __init__ and then calls connect(). If connect() fails at some point then disconnect() is called.

Within this method, to start the voice connection flow it is recommended to use Guild.change_voice_state() to start the flow. After which, on_voice_server_update() and on_voice_state_update() will be called. The order that these two are called is unspecified.

Parameters:
  • timeout (float) – The timeout for the connection.

  • reconnect (bool) – Whether reconnection is expected.

  • self_mute (bool) –

    Indicates if the client should be self-muted.

    New in version 2.0.

  • self_deaf (bool) –

    Indicates if the client should be self-deafened.

    New in version 2.0.

await disconnect(*, force: bool = False) None#

|coro|

An abstract method called when the client terminates the connection.

See cleanup().

Parameters:

force (bool) – Whether the disconnection was forced.

await update(*, track: Track | None = ..., track_identifier: str = ..., track_end_time: int = ..., replace_current_track: bool = ..., position: int = ..., paused: bool = ..., volume: int = ..., filter: Filter = ..., voice_state: VoiceStateData = ...) None#
await set_position(position: int, /) None#
await pause() None#
await set_pause_state(state: bool) None#
await resume() None#
await set_volume(volume: int, /) None#

Queue#

Objects#

Track#

class discord.ext.lava.Track(data: TrackData)#
encoded: str#
identifier: str#
author: str#
length: int#
position: int#
title: str#
uri: str | None#
artwork_url: str | None#
isrc: str | None#
source: str#
plugin_info: dict[str, Any]#
is_seekable() bool#
is_stream() bool#

Collection#

Events#

TrackStart#

TrackEnd#

TrackStuck#

TrackException#

WebsocketOpen#

WebsocketClosed#

Filters#

ChannelMix#

class discord.ext.lava.ChannelMix(*, left_to_left: float = 1.0, left_to_right: float = 0.0, right_to_left: float = 0.0, right_to_right: float = 1.0)#
property data: ChannelMixData#
classmethod mono() ChannelMix#
classmethod switch() ChannelMix#
classmethod only_left() ChannelMix#
classmethod full_left() ChannelMix#
classmethod only_right() ChannelMix#
classmethod full_right() ChannelMix#

Distortion#

class discord.ext.lava.Distortion(*, sin_offset: float = 0.0, sin_scale: float = 1.0, cos_offset: float = 0.0, cos_scale: float = 1.0, tan_offset: float = 0.0, tan_scale: float = 1.0, offset: float = 0.0, scale: float = 1.0)#
property data: DistortionData#

Equalizer#

class discord.ext.lava.Equalizer(*, bands: list[tuple[int, float]] | None = None)#
property data: list[discord.ext.lava.types.objects.filters.EqualizerBandData]#

Karaoke#

class discord.ext.lava.Karaoke(*, level: float = 1.0, mono_level: float = 1.0, filter_band: float = 220.0, filter_width: float = 100.0)#
property data: KaraokeData#

LowPass#

class discord.ext.lava.LowPass(*, smoothing: float = 1.0)#
property data: LowPassData#

Rotation#

class discord.ext.lava.Rotation(*, speed: float = 0.0)#
property data: RotationData#

Timescale#

class discord.ext.lava.Timescale(*, pitch: float = 1.0, speed: float = 1.0, rate: float = 1.0)#
property data: TimescaleData#

Tremolo#

class discord.ext.lava.Tremolo(*, frequency: float = 2.0, depth: float = 0.0)#
property data: TremoloData#

Vibrato#

class discord.ext.lava.Vibrato(*, frequency: float = 2.0, depth: float = 0.0)#
property data: VibratoData#

Volume#

Filter#

class discord.ext.lava.Filter(filter: Filter | None = None, equalizer: Equalizer | None = None, karaoke: Karaoke | None = None, timescale: Timescale | None = None, tremolo: Tremolo | None = None, vibrato: Vibrato | None = None, rotation: Rotation | None = None, distortion: Distortion | None = None, channel_mix: ChannelMix | None = None, low_pass: LowPass | None = None)#
property data: FiltersData#

Enums#

Provider#

QueueLoopMode#

Source#

Exceptions#

LavaError#

exception discord.ext.lava.LavaError#

NodeAlreadyExists#

NodeNotFound#

NoNodesConnected#

NodeAlreadyConnected#

NodeConnectionError#

InvalidPassword#

NodeNotConnected#

HTTPError#

NoResultsFound#

SearchFailed#

exception discord.ext.lava.SearchFailed(exception: ExceptionData)#

Utils#

SPOTIFY_URL_REGEX#

discord.ext.lava.SPOTIFY_URL_REGEX#

A regex that matches spotify URLs for tracks, albums, playlists, and artists.

MISSING#

discord.ext.lava.MISSING#

A sentinel value that is used to indicate a missing value with distinction from None.