Update set presence in bot manager
This commit is contained in:
@@ -165,9 +165,15 @@ class DiscordBotManager:
|
||||
LOGGER.info("Loaded OPUS library for armv7l")
|
||||
return "armv7l"
|
||||
|
||||
async def set_presence(self, presence: str):
|
||||
""" Set the presense (activity) of the bot """
|
||||
async def set_presence(self, system_name: str):
|
||||
""" Set the presence (activity) of the bot """
|
||||
if not self.bot:
|
||||
LOGGER.warning("Bot is not running, cannot set presence.")
|
||||
return
|
||||
|
||||
try:
|
||||
await self.bot.change_presence(activity=Activity(type=ActivityType.listening, name=presence))
|
||||
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}'")
|
||||
|
||||
Reference in New Issue
Block a user