mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-20 11:26:07 +00:00
feat: 更新完成的提示信息
This commit is contained in:
@@ -172,7 +172,8 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
|
|||||||
except Exception as e0:
|
except Exception as e0:
|
||||||
pkg.utils.context.get_qqbot_manager().notify_admin("更新失败:{}".format(e0))
|
pkg.utils.context.get_qqbot_manager().notify_admin("更新失败:{}".format(e0))
|
||||||
return
|
return
|
||||||
pkg.utils.reloader.reload_all()
|
pkg.utils.reloader.reload_all(notify=False)
|
||||||
|
pkg.utils.context.get_qqbot_manager().notify_admin("更新完成")
|
||||||
|
|
||||||
threading.Thread(target=update_task, daemon=True).start()
|
threading.Thread(target=update_task, daemon=True).start()
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ def walk(module, prefix=''):
|
|||||||
importlib.reload(__import__(module.__name__ + '.' + item.name, fromlist=['']))
|
importlib.reload(__import__(module.__name__ + '.' + item.name, fromlist=['']))
|
||||||
|
|
||||||
|
|
||||||
def reload_all():
|
def reload_all(notify=True):
|
||||||
# 解除bot的事件注册
|
# 解除bot的事件注册
|
||||||
import pkg
|
import pkg
|
||||||
pkg.utils.context.get_qqbot_manager().unsubscribe_all()
|
pkg.utils.context.get_qqbot_manager().unsubscribe_all()
|
||||||
@@ -42,4 +42,5 @@ def reload_all():
|
|||||||
threading.Thread(target=main.main, args=(False,), daemon=False).start()
|
threading.Thread(target=main.main, args=(False,), daemon=False).start()
|
||||||
|
|
||||||
logging.info('程序启动完成')
|
logging.info('程序启动完成')
|
||||||
pkg.utils.context.get_qqbot_manager().notify_admin("重载完成")
|
if notify:
|
||||||
|
pkg.utils.context.get_qqbot_manager().notify_admin("重载完成")
|
||||||
|
|||||||
Reference in New Issue
Block a user