Skip to content

Commit

Permalink
handle null voice server update endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Mar 10, 2024
1 parent 6361470 commit d8594d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handlers/lavalink.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func (h *Handlers) OnVoiceStateUpdate(event *events.GuildVoiceStateUpdate) {
}

func (h *Handlers) OnVoiceServerUpdate(event *events.VoiceServerUpdate) {
if event.Endpoint == nil {
return
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
h.Lavalink.OnVoiceServerUpdate(ctx, event.GuildID, event.Token, *event.Endpoint)
Expand Down

0 comments on commit d8594d9

Please sign in to comment.