1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Probably break everything related to the voice player

This commit is contained in:
Steffo 2020-06-09 02:16:27 +02:00
parent a0ac85b213
commit 85b394bb6b
Signed by: steffo
GPG key ID: 896A80F55F7C97F0

View file

@ -4,6 +4,7 @@ import logging
from typing import Optional
from .errors import *
from .playable import Playable
from ...utils import sentry_exc
try:
import discord
except ImportError:
@ -93,7 +94,11 @@ class VoicePlayer:
log.debug(f"Next source would be None, stopping here...")
return
log.debug(f"Next: {next_source}")
try:
self.voice_client.play(next_source, after=self._playback_ended)
except discord.ClientException as e:
sentry_exc(e)
await self.disconnect()
self.loop.create_task(self._playback_check())
async def _playback_check(self):
@ -106,8 +111,7 @@ class VoicePlayer:
def _playback_ended(self, error=None):
if error is not None:
# TODO: catch with Sentry
log.error(error)
sentry_exc(error)
return
self._playback_ended_event.set()