WIP: #7/fix-disconnect #8

Draft
logan wants to merge 30 commits from #7/fix-disconnect into master
Showing only changes of commit b2b15d3b7c - Show all commits

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.")