From 773137591f67864a23c200b8fdc68925854cd875 Mon Sep 17 00:00:00 2001 From: snowy Date: Thu, 9 May 2024 00:09:18 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=81=94=E5=90=88=E9=BB=91?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/__init__.py | 0 .../templates/weather_now.html | 5 +++- liteyuki/utils/__init__.py | 2 +- main.py | 25 +++++++++++-------- 4 files changed, 19 insertions(+), 13 deletions(-) delete mode 100644 liteyuki/__init__.py diff --git a/liteyuki/__init__.py b/liteyuki/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/liteyuki/resources/liteyuki_weather/templates/weather_now.html b/liteyuki/resources/liteyuki_weather/templates/weather_now.html index df8bfcb..5176d20 100644 --- a/liteyuki/resources/liteyuki_weather/templates/weather_now.html +++ b/liteyuki/resources/liteyuki_weather/templates/weather_now.html @@ -1,5 +1,5 @@ - + Liteyuki Status @@ -33,6 +33,9 @@ +
{{ data | tojson }}
diff --git a/liteyuki/utils/__init__.py b/liteyuki/utils/__init__.py index a9a7166..6a20b1a 100644 --- a/liteyuki/utils/__init__.py +++ b/liteyuki/utils/__init__.py @@ -7,7 +7,7 @@ import time import nonebot __NAME__ = "LiteyukiBot" -__VERSION__ = "6.3.0" # 60201 +__VERSION__ = "6.3.2" # 60201 import requests diff --git a/main.py b/main.py index ab89951..6914461 100644 --- a/main.py +++ b/main.py @@ -7,23 +7,26 @@ from liteyuki.utils.base.ly_api import liteyuki_api init() -store_config: dict = common_db.first(StoredConfig(), default=StoredConfig()).config -static_config = load_from_yaml("config.yml") -store_config.update(static_config) -nonebot.init(**store_config) +if __name__ == "__mp_main__": + store_config: dict = common_db.first(StoredConfig(), default=StoredConfig()).config + static_config = load_from_yaml("config.yml") + store_config.update(static_config) + nonebot.init(**store_config) -adapters = [v11.Adapter, v12.Adapter] -driver = nonebot.get_driver() + adapters = [v11.Adapter, v12.Adapter] + driver = nonebot.get_driver() -for adapter in adapters: - driver.register_adapter(adapter) - -if __name__ == "__main__": + for adapter in adapters: + driver.register_adapter(adapter) try: nonebot.load_plugin("liteyuki.liteyuki_main") nonebot.load_from_toml("pyproject.toml") - nonebot.run() except BaseException as e: if not isinstance(e, KeyboardInterrupt): nonebot.logger.error(f"An error occurred: {e}, Bug will be reported automatically.") liteyuki_api.bug_report(str(e.__repr__())) + +if __name__ == "__main__": + from liteyuki.utils.base.reloader import Reloader + + nonebot.run()