From 49841a04a33393a491bc35b9e461f3fdd82312d4 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Wed, 29 Dec 2021 00:50:37 -0500 Subject: [PATCH] Update: Profile update --- bot.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bot.py b/bot.py index 1685f38..d299434 100644 --- a/bot.py +++ b/bot.py @@ -323,7 +323,7 @@ class Bot(commands.Bot): elif not connected: await self.change_presence(activity=discord.Game(name=f"@ me"), status=discord.Status.idle) - def save_radio_config(self, profile_name): + async def save_radio_config(self, profile_name): config = configparser.SafeConfigParser() if os.path.exists('./profiles.ini'): @@ -344,11 +344,9 @@ class Bot(commands.Bot): if self.sdr_started: self.start_sdr() - loop = asyncio.get_event_loop() - coroutine = self.set_activity() - loop.run_until_complete(coroutine) + await self.set_activity() - def load_radio_config(self, profile_name): + async def load_radio_config(self, profile_name): config = configparser.ConfigParser() if os.path.exists('./profiles.ini'): config.read('./profiles.ini') @@ -363,9 +361,7 @@ class Bot(commands.Bot): if self.sdr_started: self.start_sdr() - loop = asyncio.get_event_loop() - coroutine = self.set_activity() - loop.run_until_complete(coroutine) + await self.set_activity() return True else: