From 7564c37f1443808feb66c682f947dfa5eabc76ab Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 30 May 2022 22:53:25 -0600 Subject: [PATCH] Fix updates to use *_extension instead of *_cog --- jarvis/utils/updates.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/jarvis/utils/updates.py b/jarvis/utils/updates.py index 46b6e28..2c1d21b 100644 --- a/jarvis/utils/updates.py +++ b/jarvis/utils/updates.py @@ -151,20 +151,20 @@ async def update(bot: "Client") -> Optional[UpdateResult]: for module in current_commands.keys(): if module not in new_commands: logger.debug("Module %s removed after update", module) - bot.drop_cog(module) + bot.unload_extension(module) unloaded.append(module) logger.debug("Checking for new/modified commands") for module, commands in new_commands.items(): logger.debug("Processing %s", module) if module not in current_commands: - bot.load_cog(module) + bot.load_extension(module) loaded.append(module) elif len(current_commands[module]) != len(commands): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) else: for command in commands: @@ -187,23 +187,23 @@ async def update(bot: "Client") -> Optional[UpdateResult]: # Check if number arguments have changed if len(old_args) != len(new_args): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) elif any(x not in old_arg_names for x in new_arg_names) or any( x not in new_arg_names for x in old_arg_names ): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) elif any(new_args[idx].type != x.type for idx, x in enumerate(old_args)): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) return UpdateResult(