From e441ba63a006c37dd8e68c647ae4a9b097c6f943 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Wed, 4 Aug 2021 14:12:14 +0100 Subject: [PATCH] Hotfix for enabling the /tcard command --- app/cogs/slashcommands/config.py | 6 ++++++ app/cogs/slashcommands/secondary/game_create.py | 3 +++ app/cogs/slashcommands/secondary/game_management.py | 2 ++ .../slashcommands/secondary/manipulate_timeslots.py | 13 +++++-------- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/cogs/slashcommands/config.py b/app/cogs/slashcommands/config.py index a7afe64..6df67e8 100644 --- a/app/cogs/slashcommands/config.py +++ b/app/cogs/slashcommands/config.py @@ -123,6 +123,9 @@ class Configuration(commands.Cog, name='Configuration Commands'): if self.client.get_cog('Player Commands') is None: loadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') flag = True + if self.client.get_cog('T-Card Command') is None: + loadCog(f'./{cogsDir}/slashcommands/secondary/tcard.py') + flag = True if self.client.get_cog('Pitch Command') is None: loadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') flag = True @@ -301,6 +304,9 @@ class Configuration(commands.Cog, name='Configuration Commands'): if self.client.get_cog('Player Commands') is None: loadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') Flag = True + if self.client.get_cog('T-Card Command') is None: + loadCog(f'./{cogsDir}/slashcommands/secondary/tcard.py') + Flag = True if self.client.get_cog('Pitch Command') is None: loadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') Flag = True diff --git a/app/cogs/slashcommands/secondary/game_create.py b/app/cogs/slashcommands/secondary/game_create.py index 8838e7d..351c8f7 100644 --- a/app/cogs/slashcommands/secondary/game_create.py +++ b/app/cogs/slashcommands/secondary/game_create.py @@ -290,6 +290,9 @@ class GameCreate(commands.Cog, name='Game Create'): if self.client.get_cog('Player Commands') is None: loadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') flag = True + if self.client.get_cog('T-Card Command') is None: + loadCog(f'./{cogsDir}/slashcommands/secondary/tcard.py') + flag = True if self.client.get_cog('Pitch Command') is None: loadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') flag = True diff --git a/app/cogs/slashcommands/secondary/game_management.py b/app/cogs/slashcommands/secondary/game_management.py index 0771db1..e994377 100644 --- a/app/cogs/slashcommands/secondary/game_management.py +++ b/app/cogs/slashcommands/secondary/game_management.py @@ -97,6 +97,7 @@ class GameManagement(commands.Cog, name='Game Management'): if not any([x for x in yaml_load(lookupFile).values()]): unloadCog(f'./{cogsDir}/slashcommands/secondary/game_management.py') if self.client.get_cog('Player Commands') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') + if self.client.get_cog('T-Card Command') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/tcard.py') if self.client.get_cog('Pitch Command') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') await self.client.slash.sync_all_commands() @@ -553,6 +554,7 @@ class GameManagement(commands.Cog, name='Game Management'): if not any([x for x in yaml_load(lookupFile).values()]): unloadCog(f'./{cogsDir}/slashcommands/secondary/game_management.py') if self.client.get_cog('Player Commands') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') + if self.client.get_cog('T-Card Command') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/tcard.py') if self.client.get_cog('Pitch Command') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') await self.client.slash.sync_all_commands() diff --git a/app/cogs/slashcommands/secondary/manipulate_timeslots.py b/app/cogs/slashcommands/secondary/manipulate_timeslots.py index d7e6dd3..f347a95 100644 --- a/app/cogs/slashcommands/secondary/manipulate_timeslots.py +++ b/app/cogs/slashcommands/secondary/manipulate_timeslots.py @@ -91,14 +91,11 @@ class ManipulateTimeslots(commands.Cog, name='Manipulate Timeslots'): yaml_dump(conf, configFile) if not any([x['timeslots'] for x in yaml_load(configFile).values()]): unloadCog(f'./{cogsDir}/slashcommands/secondary/manipulate_timeslots.py') - if self.client.get_cog('Game Management') is not None: - unloadCog(f'./{cogsDir}/slashcommands/secondary/game_management.py') - if self.client.get_cog('Game Create') is not None: - unloadCog(f'./{cogsDir}/slashcommands/secondary/game_create.py') - if self.client.get_cog('Player Commands') is not None: - unloadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') - if self.client.get_cog('Pitch Command') is not None: - unloadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') + if self.client.get_cog('Game Management') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/game_management.py') + if self.client.get_cog('Game Create') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/game_create.py') + if self.client.get_cog('Player Commands') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/player_commands.py') + if self.client.get_cog('T-Card Command') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/tcard.py') + if self.client.get_cog('Pitch Command') is not None: unloadCog(f'./{cogsDir}/slashcommands/secondary/pitch.py') await self.client.slash.sync_all_commands() else: await ctx.send('```Error: You cannot delete a timeslot that has existing game entries. Please delete all games first.```',hidden=True)