From 3cf5bc0d05fcd90185be721b92071040fa2a0425 Mon Sep 17 00:00:00 2001 From: Logan Date: Sun, 12 Apr 2026 03:26:33 -0400 Subject: [PATCH] updates --- drb-edge-node/app/internal/discord_radio.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drb-edge-node/app/internal/discord_radio.py b/drb-edge-node/app/internal/discord_radio.py index b7a77c3..68d61fa 100644 --- a/drb-edge-node/app/internal/discord_radio.py +++ b/drb-edge-node/app/internal/discord_radio.py @@ -17,6 +17,7 @@ class RadioBot: self._watchdog_task: Optional[asyncio.Task] = None self._ready_event: Optional[asyncio.Event] = None self._current_token: Optional[str] = None + self._loop: Optional[asyncio.AbstractEventLoop] = None # Remembered so we can rejoin after an unexpected disconnect self._guild_id: Optional[int] = None @@ -115,8 +116,8 @@ class RadioBot: def _on_stream_end(self, error): if error: logger.error(f"Stream ended: {error}") - if self._voice_client and self._voice_client.is_connected() and not self._voice_client.is_playing(): - asyncio.get_event_loop().call_soon_threadsafe(self._play_stream) + if self._loop and self._voice_client and self._voice_client.is_connected() and not self._voice_client.is_playing(): + self._loop.call_soon_threadsafe(self._play_stream) def _stop_stream(self): if self._voice_client and self._voice_client.is_playing(): @@ -162,6 +163,7 @@ class RadioBot: self._bot = commands.Bot(command_prefix="!", intents=intents) self._ready_event = asyncio.Event() self._current_token = token + self._loop = asyncio.get_event_loop() @self._bot.event async def on_ready():