mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 11:34:18 +00:00
Probably break everything related to the voice player
This commit is contained in:
parent
a0ac85b213
commit
85b394bb6b
1 changed files with 7 additions and 3 deletions
|
@ -4,6 +4,7 @@ import logging
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from .errors import *
|
from .errors import *
|
||||||
from .playable import Playable
|
from .playable import Playable
|
||||||
|
from ...utils import sentry_exc
|
||||||
try:
|
try:
|
||||||
import discord
|
import discord
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -93,7 +94,11 @@ class VoicePlayer:
|
||||||
log.debug(f"Next source would be None, stopping here...")
|
log.debug(f"Next source would be None, stopping here...")
|
||||||
return
|
return
|
||||||
log.debug(f"Next: {next_source}")
|
log.debug(f"Next: {next_source}")
|
||||||
self.voice_client.play(next_source, after=self._playback_ended)
|
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())
|
self.loop.create_task(self._playback_check())
|
||||||
|
|
||||||
async def _playback_check(self):
|
async def _playback_check(self):
|
||||||
|
@ -106,8 +111,7 @@ class VoicePlayer:
|
||||||
|
|
||||||
def _playback_ended(self, error=None):
|
def _playback_ended(self, error=None):
|
||||||
if error is not None:
|
if error is not None:
|
||||||
# TODO: catch with Sentry
|
sentry_exc(error)
|
||||||
log.error(error)
|
|
||||||
return
|
return
|
||||||
self._playback_ended_event.set()
|
self._playback_ended_event.set()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue