diff --git a/royalnet/backpack/commands/summon.py b/royalnet/backpack/commands/summon.py index 6c40f059..09c3ea27 100644 --- a/royalnet/backpack/commands/summon.py +++ b/royalnet/backpack/commands/summon.py @@ -44,7 +44,7 @@ class SummonCommand(Command): channel: discord.VoiceChannel = voice.channel # Try to connect to the voice channel try: - await channel.connect() + client = await channel.connect() except asyncio.TimeoutError: raise ExternalError("Timed out while trying to connect to the channel") except discord.opus.OpusNotLoaded: @@ -52,3 +52,5 @@ class SummonCommand(Command): except discord.ClientException as e: # TODO: handle this someway raise + await asyncio.sleep(6) + breakpoint() diff --git a/royalnet/serf/discord/discordserf.py b/royalnet/serf/discord/discordserf.py index 7c1623c4..f19b137c 100644 --- a/royalnet/serf/discord/discordserf.py +++ b/royalnet/serf/discord/discordserf.py @@ -124,7 +124,7 @@ class DiscordSerf(Serf): # Prepare data data = self.Data(interface=command.interface, session=session, loop=self.loop, message=message) # Call the command - self.call(command, data, parameters) + await self.call(command, data, parameters) # Close the alchemy session if session is not None: await asyncify(session.close) diff --git a/royalnet/serf/serf.py b/royalnet/serf/serf.py index bbf9ec24..0f0b9d19 100644 --- a/royalnet/serf/serf.py +++ b/royalnet/serf/serf.py @@ -284,7 +284,7 @@ class Serf: username: the name of the secret that should be retrieved.""" return get_password(f"Royalnet/{self.secrets_name}", username) - def call(self, command: Command, data: CommandData, parameters: List[str]): + async def call(self, command: Command, data: CommandData, parameters: List[str]): try: # Run the command await command.run(CommandArgs(parameters), data) diff --git a/royalnet/serf/telegram/telegramserf.py b/royalnet/serf/telegram/telegramserf.py index d152d526..b57cfac1 100644 --- a/royalnet/serf/telegram/telegramserf.py +++ b/royalnet/serf/telegram/telegramserf.py @@ -197,7 +197,7 @@ class TelegramSerf(Serf): # Prepare data data = self.Data(interface=command.interface, session=session, loop=self.loop, message=message) # Call the command - self.call(command, data, parameters) + await self.call(command, data, parameters) # Close the alchemy session if session is not None: await asyncify(session.close)