From d16ccc49fb267419487bbc37831a752f896df26e Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Fri, 18 Feb 2022 23:24:33 -0500 Subject: [PATCH] Added a command to display the current settings --- bot.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bot.py b/bot.py index bd8e063..487eaca 100644 --- a/bot.py +++ b/bot.py @@ -208,6 +208,12 @@ class Bot(commands.Bot): else: await ctx.send(f"{str(member).capitalize()}, there is no profile with the name '{profile_name}'") + @self.command(name='displayprofile', hidden=True) + async def _displayprofile(ctx, member: discord.Member = None): + member = member or ctx.author.display_name + message = self.display_current_radio_config() + await ctx.send(f"Ok {str(member).capitalize()}\n{message}") + # Hidden admin commands @self.command(name='reload', hidden=True) async def _reload(ctx, module: str, member: discord.Member = None): @@ -435,6 +441,17 @@ class Bot(commands.Bot): else: return False + def display_current_radio_config(self): + message_body = "" + if self.profile_name: + message_body += f"Profile Name: {self.profile_name}\n" + message_body += f"Frequency: {self.freq}\n" \ + f"Mode: {self.mode}\n" + if self.squelch: + message_body += f"Squelch: {self.squelch}" + + return message_body + # Check if message is a ping request and respond even if it is a bot async def check_and_reply_to_ping(self, message): if "ping" in message.content: