Skip to content

Events

The events emitted by a DisTube instance.

ADD_LIST: "addList";

Emitted after a new playlist is added to a Queue.


ADD_SONG: "addSong";

Emitted after a new song is added to a Queue.


CHANGE_FILTER: "changeFilter";

Emitted when the audio filters of a Queue are changed.


DEBUG: "debug";

Emitted to provide debug information from DisTube’s operation.


DELETE_QUEUE: "deleteQueue";

Emitted when a Queue is deleted.


DISCONNECT: "disconnect";

Emitted when the bot is disconnected from a voice channel.


EMPTY: "empty";

Emitted when a Queue runs out of songs to play.


ERROR: "error";

Emitted when DisTube encounters an error while playing songs.

It is the only special event: Node.js crashes the process when the "error" event is emitted without any listener. DisTube handles it gracefully instead, following DisTubeOptions.unhandledError.


FFMPEG_DEBUG: "ffmpegDebug";

Emitted for logging FFmpeg debug information.


FINISH: "finish";

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


FINISH_SONG: "finishSong";

Emitted when a song finished playing.


INIT_QUEUE: "initQueue";

Emitted when a Queue is initialized, to change its default properties.


NO_RELATED: "noRelated";

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


PAUSE_SONG: "pauseSong";

Emitted when a guild stream is paused.


PLAY_SONG: "playSong";

Emitted when a song starts playing.


PRELOAD_ERROR: "preloadError";

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


PRELOAD_SONG: "preloadSong";

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


PRELOADED_SONG: "preloadedSong";

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


RESUME_SONG: "resumeSong";

Emitted when a paused guild stream is resumed.


SEEK_SONG: "seekSong";

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


SET_VOLUME: "setVolume";

Emitted when the volume of a guild stream is changed.


SHUFFLE_QUEUE: "shuffleQueue";

Emitted after the songs of a Queue have been shuffled.


SKIP_SONG: "skipSong";

Emitted when a song is skipped.


VOICE_CHANNEL_CHANGE: "voiceChannelChange";

Emitted when the bot is moved to another voice channel.