Fix client when client ID is passed

This commit is contained in:
Logan Cusano
2025-08-01 23:32:17 -04:00
parent fffe1511e0
commit b2b15d3b7c

View File

@@ -157,8 +157,8 @@ class VoiceCog(commands.Cog):
# --- Discord Bot Manager Class ---
class DiscordBotManager:
def __init__(self, client_id: str, device_id: int = 0, ng_threshold: int = 50):
self.client_id = client_id
def __init__(self, device_id: int = 0, ng_threshold: int = 50):
self.client_id = None
self.device_id = device_id
self.ng_threshold = ng_threshold
self.bot = None
@@ -182,10 +182,12 @@ class DiscordBotManager:
# Set initial presence when the bot is ready
await self.set_presence("Broadcasting...", discord.Game)
async def start_bot(self):
async def start_bot(self, client_id: str):
if self.bot and self.bot.is_ready():
print("Bot is already running.")
return
self.client_id = client_id
if not load_opus():
print("Failed to load Opus library. Bot cannot start voice features.")