From e8c79454a55a5ea960fbbc92c428c5e64bfb8605 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Mon, 14 Jul 2025 22:26:57 -0400 Subject: [PATCH] fix missing function --- app/internal/bot_manager.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/internal/bot_manager.py b/app/internal/bot_manager.py index 1ecc1f6..24504aa 100644 --- a/app/internal/bot_manager.py +++ b/app/internal/bot_manager.py @@ -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.") \ No newline at end of file + 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}'") \ No newline at end of file