From fb3fe711196985eb4d3d42b7d7ab8ed86a771b68 Mon Sep 17 00:00:00 2001 From: Ilija Ivanov <6906399+MetalBreaker@users.noreply.github.com> Date: Tue, 17 Nov 2020 00:56:43 +0100 Subject: [PATCH] Update Discord voice timeout From my own testing, I've come to the conclusion that the default timeout is too short - the bot would stop playing music if the voice connection got lost for a moment or if it was moved to another channel. I think 5 seconds is plenty of time for it to reconnect to voice if it disconnects. Thanks for this great project. --- stream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stream.go b/stream.go index 6c23f59..084e1f7 100644 --- a/stream.go +++ b/stream.go @@ -99,10 +99,10 @@ func (s *StreamingSession) readNext() error { return err } - // Timeout after 100ms (Maybe this needs to be changed?) - timeOut := time.After(time.Second) + // Timeout after 5 seconds + timeOut := time.After(5 * time.Second) - // This will attempt to send on the channel before the timeout, which is 1s + // This will attempt to send on the channel before the timeout, which is 5s select { case <-timeOut: return ErrVoiceConnClosed