WIP: #7/fix-disconnect #8

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

View File

@@ -166,4 +166,16 @@ class DiscordBotManager:
raise RuntimeError("Could not load a valid Opus library. Voice functionality will fail.")
if not opus.is_loaded():
raise RuntimeError("Opus library could not be loaded. Please ensure it is installed correctly.")
raise RuntimeError("Opus library could not be loaded. Please ensure it is installed correctly.")
async def set_presence(self, system_name: str):
if not self.bot or not self.bot.is_ready():
LOGGER.warning("Bot is not ready, cannot set presence.")
return
try:
activity = Activity(type=ActivityType.listening, name=system_name)
await self.bot.change_presence(activity=activity)
LOGGER.info(f"Bot presence set to 'Listening to {system_name}'")
except Exception as pe:
LOGGER.error(f"Unable to set presence: '{pe}'")