More detailed update response

This commit is contained in:
Zeva Rose 2022-04-30 23:11:50 -06:00
parent e71df2ef10
commit 960fbb1c50

View file

@ -81,8 +81,10 @@ class BotutilCog(Scale):
repo = git.Repo(".")
current_hash = repo.head.object.hexsha
origin = repo.remotes.origin
origin.fetch()
remote_hash = origin.refs[repo.active_branch.name].object.hexsha
if current_hash != origin.refs[repo.active_branch.name].object.hexsha:
if current_hash != remote_hash:
current_commands = get_all_commands()
_ = origin.pull()
await asyncio.sleep(3)
@ -107,7 +109,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)
await ctx.reply("Updates applied!")
await ctx.reply(f"Updates applied! `{current_hash}` => `{remote_hash}`")
else:
await ctx.reply("No updates to apply")