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:
parent
a0ac85b213
commit
85b394bb6b
1 changed files with 7 additions and 3 deletions
|
@ -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}")
|
||||
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())
|
||||
|
||||
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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue