From 8dc68b089839820ea7006f712cc3f398bdf1d9b7 Mon Sep 17 00:00:00 2001 From: Rafael Vargas Date: Wed, 8 Feb 2023 23:27:57 -0300 Subject: [PATCH] Fixing error 35 --- Parallelism/PlayerProcess.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Parallelism/PlayerProcess.py b/Parallelism/PlayerProcess.py index 9ff61ca..de09f39 100644 --- a/Parallelism/PlayerProcess.py +++ b/Parallelism/PlayerProcess.py @@ -1,5 +1,5 @@ import asyncio -from time import time +from time import sleep, time from urllib.parse import parse_qs, urlparse from Music.VulkanInitializer import VulkanInitializer from discord import User, Member, Message, VoiceClient @@ -257,6 +257,13 @@ class PlayerProcess(Process): self.__loop.create_task(self.__playSong(song), name=f'Song {song.identifier}') def __commandsReceiver(self) -> None: + # Forces the Thread that listen to the commands to await this bot instance + # to stablish the connection with discord, may delay when running bots in several servers + while True: + if self.__guildID is not None: + break + sleep(0.1) + while True: command: VCommands = self.__queueReceive.get() type = command.getType()