From 7b58799156ccf187281f3392db019a44425434e3 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Sat, 17 Sep 2022 18:25:15 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D`=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=9B=B4=E6=96=B0`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/manager/bot_manager/handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LittlePaimon/manager/bot_manager/handler.py b/LittlePaimon/manager/bot_manager/handler.py index 9888121..cfd3964 100644 --- a/LittlePaimon/manager/bot_manager/handler.py +++ b/LittlePaimon/manager/bot_manager/handler.py @@ -1,5 +1,4 @@ from pathlib import Path -import time import git from nonebot.utils import run_sync from git.exc import GitCommandError, InvalidGitRepositoryError @@ -19,7 +18,7 @@ async def check_update(): local_commit = repo.head.commit remote_commit = [] for commit in data: - if local_commit.binsha == commit['sha']: + if str(local_commit) == commit['sha']: break remote_commit.append(commit) if not remote_commit: @@ -45,4 +44,4 @@ def update(): return f'更新失败,错误信息:{e},请手动进行更新' finally: repo.git.stash('pop') - return f'更新完成,版本:{__version__}\n可使用命令[@bot 重启]重启{NICKNAME}' + return f'更新完成,版本:{__version__}\n最新更新日志为:\n{repo.head.commit.message.replace(":bug:", "🐛").replace(":sparkles:", "✨").replace(":memo:", "📝")}\n可使用命令[@bot 重启]重启{NICKNAME}'