Add console logging to update

This commit is contained in:
Zeva Rose 2022-04-30 23:16:43 -06:00
parent 849ea4770b
commit 6f0d157961

View file

@ -85,8 +85,10 @@ class BotutilCog(Scale):
remote_hash = origin.refs[repo.active_branch.name].object.hexsha
if current_hash != remote_hash:
self.logger.info("Updating...")
current_commands = get_all_commands()
origin.pull()
self.logger.info("Changes pulled...")
await asyncio.sleep(3)
new_commands = get_all_commands()
for module, commands in new_commands:
@ -109,6 +111,7 @@ class BotutilCog(Scale):
self.bot.reload_extension(module)
elif any(new_args[x] != y for x, y in old_args):
self.bot.reload_extension(module)
self.logger.info("Updates applied")
await ctx.reply(f"Updates applied! `{current_hash}` => `{remote_hash}`")
else:
await ctx.reply(f"No updates to apply. `{current_hash}` == `{remote_hash}`")