Skip to content

TrackEndEvent

The TrackEndEvent is sent by the server to the client whenever a track finishes playing, is stopped, or is replaced.


FieldTypeDescription
opstringAlways event
typestringAlways TrackEndEvent
guildIdstringThe Discord guild ID
trackobjectThe Track that ended
reasonstringThe reason why the track ended

ReasonDescription
finishedThe track finished playing naturally
loadFailedThe track failed to load
stoppedThe track was explicitly stopped
replacedThe track was replaced by another track
cleanupThe player was cleaned up due to inactivity

{
"op": "event",
"type": "TrackEndEvent",
"guildId": "1234567890",
"track": {
"encoded": "...",
"info": { ... }
},
"reason": "finished"
}