feat: 输出版本时检查是否有新版

This commit is contained in:
Rock Chin
2023-01-05 21:07:17 +08:00
parent ee76929fee
commit bd920cedf5

View File

@@ -243,7 +243,14 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
and not config.include_image_description):
reply.append(" ".join(params))
elif cmd == 'version':
reply = ["[bot]当前版本:\n{}".format(pkg.utils.updater.get_current_version_info())]
reply_str = "[bot]当前版本:{}\n".format(pkg.utils.updater.get_current_version_info())
try:
if pkg.utils.updater.is_new_version_available():
reply_str += "\n有新版本可用,请使用命令 !update 进行更新"
except:
pass
reply = [reply_str]
elif cmd == 'reload' and launcher_type == 'person' and launcher_id == config.admin_qq:
def reload_task():
pkg.utils.reloader.reload_all()