fix join loop
This commit is contained in:
@@ -109,14 +109,10 @@ class NoiseGate(AudioStream):
|
|||||||
self.stream.start_stream()
|
self.stream.start_stream()
|
||||||
self.core()
|
self.core()
|
||||||
|
|
||||||
def core(self, error=None):
|
def core(self):
|
||||||
if error:
|
|
||||||
LOGGER.warning(f"Audio stream stopped unexpectedly with error: {error}")
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.voice_connection.is_connected() and not self.voice_connection.is_playing():
|
if self.voice_connection.is_connected() and not self.voice_connection.is_playing():
|
||||||
LOGGER.debug("Playing stream to discord")
|
LOGGER.debug("Playing stream to discord")
|
||||||
self.voice_connection.play(self.NGStream, after=lambda e: self.core(e))
|
self.voice_connection.play(self.NGStream)
|
||||||
|
|
||||||
async def close(self):
|
async def close(self):
|
||||||
LOGGER.debug("Closing NoiseGate resources...")
|
LOGGER.debug("Closing NoiseGate resources...")
|
||||||
|
|||||||
Reference in New Issue
Block a user