Player Events: Track Events
These events are triggered during the lifecycle of track playback — from start, to end, to error handling.
They are useful for reacting to playback changes or handling track failures gracefully.
These interfaces extendBaseEvent.
TrackStartEvent
Emitted when a track begins playback.
Extends:BaseEvent.
Property Type Description Optional opstring = "event" Lavalink operation type. typestring = "TrackStartEvent" Event type identifier. guildIdstring Guild this event applies to. trackTrackDataTrack that started playing.
TrackEndEvent
Emitted when a track finishes playing, whether normally or due to skipping, failure, or replacement.
Extends:BaseEvent.
Property Type Description Optional opstring = "event" Lavalink operation type. typestring = "TrackEndEvent" Event type identifier. guildIdstring Guild this event applies to. trackTrackDataTrack that ended. reasonTrackEndReasonTypesReason for track ending.
TrackExceptionEvent
Emitted when a track fails during playback due to an internal error.
Extends:BaseEvent.
Property Type Description Optional opstring = "event" Lavalink operation type. typestring = "TrackExceptionEvent" Event type identifier. guildIdstring Guild this event applies to. exceptionException| undefinedError details from Lavalink.
TrackStuckEvent
Emitted when Lavalink fails to decode audio frames within the given threshold — often indicating a corrupted or inaccessible track.
Extends:BaseEvent.
Property Type Description Optional opstring = "event" Lavalink operation type. typestring = "TrackStuckEvent" Event type identifier. guildIdstring Guild this event applies to. thresholdMsnumber Threshold in milliseconds Lavalink waited before reporting stuck.