Skip to main content
Version: v2.9.0

Player Events: WebSocket Events

This event is emitted when the Discord voice WebSocket connection closes unexpectedly or intentionally.
It is useful for detecting disconnects, kicks, region changes, or bot mutes via server events.
These interfaces extend BaseEvent.


WebSocketClosedEvent

Emitted when the Discord voice WebSocket connection is closed for any reason.
Extends: BaseEvent.

Property Type Description Optional
opstring = "event"Lavalink operation type.
typestring = "WebSocketClosedEvent"Event type identifier.
guildIdstringGuild this event applies to.
codenumberWebSocket close code provided by Discord.
reasonstringReason string provided by Discord.
byRemotebooleanWhether the closure was initiated remotely (by Discord).