Fix client when client ID is passed
This commit is contained in:
@@ -157,8 +157,8 @@ class VoiceCog(commands.Cog):
|
|||||||
|
|
||||||
# --- Discord Bot Manager Class ---
|
# --- Discord Bot Manager Class ---
|
||||||
class DiscordBotManager:
|
class DiscordBotManager:
|
||||||
def __init__(self, client_id: str, device_id: int = 0, ng_threshold: int = 50):
|
def __init__(self, device_id: int = 0, ng_threshold: int = 50):
|
||||||
self.client_id = client_id
|
self.client_id = None
|
||||||
self.device_id = device_id
|
self.device_id = device_id
|
||||||
self.ng_threshold = ng_threshold
|
self.ng_threshold = ng_threshold
|
||||||
self.bot = None
|
self.bot = None
|
||||||
@@ -182,10 +182,12 @@ class DiscordBotManager:
|
|||||||
# Set initial presence when the bot is ready
|
# Set initial presence when the bot is ready
|
||||||
await self.set_presence("Broadcasting...", discord.Game)
|
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():
|
if self.bot and self.bot.is_ready():
|
||||||
print("Bot is already running.")
|
print("Bot is already running.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.client_id = client_id
|
||||||
|
|
||||||
if not load_opus():
|
if not load_opus():
|
||||||
print("Failed to load Opus library. Bot cannot start voice features.")
|
print("Failed to load Opus library. Bot cannot start voice features.")
|
||||||
|
|||||||
Reference in New Issue
Block a user