1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

smol bugfix

This commit is contained in:
Steffo 2019-11-16 14:04:01 +01:00
parent 34d682f0e3
commit 5ebdf49766
4 changed files with 6 additions and 4 deletions

View file

@ -44,7 +44,7 @@ class SummonCommand(Command):
channel: discord.VoiceChannel = voice.channel channel: discord.VoiceChannel = voice.channel
# Try to connect to the voice channel # Try to connect to the voice channel
try: try:
await channel.connect() client = await channel.connect()
except asyncio.TimeoutError: except asyncio.TimeoutError:
raise ExternalError("Timed out while trying to connect to the channel") raise ExternalError("Timed out while trying to connect to the channel")
except discord.opus.OpusNotLoaded: except discord.opus.OpusNotLoaded:
@ -52,3 +52,5 @@ class SummonCommand(Command):
except discord.ClientException as e: except discord.ClientException as e:
# TODO: handle this someway # TODO: handle this someway
raise raise
await asyncio.sleep(6)
breakpoint()

View file

@ -124,7 +124,7 @@ class DiscordSerf(Serf):
# Prepare data # Prepare data
data = self.Data(interface=command.interface, session=session, loop=self.loop, message=message) data = self.Data(interface=command.interface, session=session, loop=self.loop, message=message)
# Call the command # Call the command
self.call(command, data, parameters) await self.call(command, data, parameters)
# Close the alchemy session # Close the alchemy session
if session is not None: if session is not None:
await asyncify(session.close) await asyncify(session.close)

View file

@ -284,7 +284,7 @@ class Serf:
username: the name of the secret that should be retrieved.""" username: the name of the secret that should be retrieved."""
return get_password(f"Royalnet/{self.secrets_name}", username) 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: try:
# Run the command # Run the command
await command.run(CommandArgs(parameters), data) await command.run(CommandArgs(parameters), data)

View file

@ -197,7 +197,7 @@ class TelegramSerf(Serf):
# Prepare data # Prepare data
data = self.Data(interface=command.interface, session=session, loop=self.loop, message=message) data = self.Data(interface=command.interface, session=session, loop=self.loop, message=message)
# Call the command # Call the command
self.call(command, data, parameters) await self.call(command, data, parameters)
# Close the alchemy session # Close the alchemy session
if session is not None: if session is not None:
await asyncify(session.close) await asyncify(session.close)