Added activity if there is no handler selected

This commit is contained in:
Logan Cusano
2022-02-13 15:25:50 -05:00
parent 720ff6b5c2
commit 6b9e48d722

19
bot.py
View File

@@ -285,14 +285,19 @@ class Bot(commands.Bot):
# Set the activity of the bot
async def set_activity(self, connected=True):
if connected:
if self.profile_name is None:
if self.Handler == 'gqrx':
if self.profile_name is None:
await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening,
name=f"{self.freq[:-1]}"
f" {str(self.mode).upper()}"),
status=discord.Status.online)
elif type(self.profile_name) == str:
await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening,
name=f"{str(self.profile_name).upper()}"),
status=discord.Status.online)
else:
await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening,
name=f"{self.freq[:-1]}"
f" {str(self.mode).upper()}"),
status=discord.Status.online)
elif type(self.profile_name) == str:
await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening,
name=f"{str(self.profile_name).upper()}"),
name=f"the airwaves"),
status=discord.Status.online)
elif not connected:
await self.change_presence(activity=discord.Game(name=f"@ me"), status=discord.Status.idle)