feat: 热重载前后更新bot事件订阅

This commit is contained in:
Rock Chin
2023-01-02 11:33:26 +08:00
parent bc3cffa041
commit 14154bafd0
3 changed files with 32 additions and 15 deletions

View File

@@ -21,11 +21,13 @@ def walk(module, prefix=''):
def reload_all():
# 解除bot的事件注册
import pkg
pkg.utils.context.get_qqbot_manager().unsubscribe_all()
# 执行关闭流程
logging.info("执行程序关闭流程")
import main
main.stop()
import pkg
context = pkg.utils.context.context
walk(pkg)