Update: Updated the activity whenever the freq changes

This commit is contained in:
Logan Cusano
2021-12-28 02:27:25 -05:00
parent 8391df4209
commit eb9ba7f576

7
bot.py
View File

@@ -73,7 +73,8 @@ class Bot(commands.Bot):
self.start_sdr()
await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening,
name=f"{self.freq[:-1]} {str(self.mode).capitalize()}"),
name=f"{self.freq[:-1]}"
f" {str(self.mode).upper()}"),
status=discord.Status.online)
else:
await ctx.send("Opus won't load")
@@ -99,6 +100,10 @@ class Bot(commands.Bot):
await ctx.send(f"Ok {member}, I'm changing the mode to {self.mode} and frequency to {self.freq}")
if self.sdr_started:
self.start_sdr()
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)
else:
await ctx.send(f"{member}, {mode} is not valid. You may only enter 'fm' or 'wbfm'")
else: