Skip to content

DisTubeEvents

type DisTubeEvents = object;

The arguments of every Events event.

It is the source of truth of the signature of the event listeners:

TypedDisTubeEvents

addList: [queue: Queue, playlist: Playlist];

Emitted after a new playlist is added to a Queue.


addSong: [queue: Queue, song: Song];

Emitted after a new song is added to a Queue.


changeFilter: [queue: Queue, newFilters: string[], oldFilters: string[]];

Emitted when the audio filters of a Queue are changed.


debug: [debug: string];

Emitted to provide debug information from DisTube’s operation.


deleteQueue: [queue: Queue];

Emitted when a Queue is deleted.


disconnect: [queue: Queue];

Emitted when the bot is disconnected from a voice channel.


empty: [queue: Queue];

Emitted when a Queue runs out of songs to play.


error: [error: Error, queue: Queue, song: Song | undefined];

Emitted when DisTube encounters an error while playing songs.


ffmpegDebug: [debug: string];

Emitted for logging FFmpeg debug information.


finish: [queue: Queue];

Emitted when a Queue is finished, and its autoplay mode is disabled.


finishSong: [queue: Queue, song: Song];

Emitted when a song finished playing.


initQueue: [queue: Queue];

Emitted when a Queue is initialized.


noRelated: [queue: Queue, error: DisTubeError];

Emitted when the autoplay mode is enabled and no related song could be found.


pauseSong: [queue: Queue, song: Song];

Emitted when a guild stream is paused.


playSong: [queue: Queue, song: Song];

Emitted when a song starts playing.


preloadedSong: [queue: Queue, song: Song];

Emitted when the next song in a Queue has been pre-buffered and is ready.


preloadError: [queue: Queue, song: Song, error: Error];

Emitted when pre-buffering the next song in a Queue fails.


preloadSong: [queue: Queue, song: Song];

Emitted when DisTube starts pre-buffering / pre-fetching the next song in a Queue.


resumeSong: [queue: Queue, song: Song];

Emitted when a paused guild stream is resumed.


seekSong: [queue: Queue, song: Song, position: number];

Emitted when a guild stream is seeked to a new position.


setVolume: [queue: Queue, volume: number, oldVolume: number];

Emitted when the volume of a guild stream is changed.


shuffleQueue: [queue: Queue, songs: Song[]];

Emitted after the songs of a Queue have been shuffled.


skipSong: [queue: Queue, song: Song];

Emitted when a song is skipped.


voiceChannelChange: [queue: Queue, oldChannel: VoiceBasedChannel, newChannel: VoiceBasedChannel];

Emitted when the bot is moved to another voice channel.