2024-03-18 18:21:56 +08:00
|
|
|
import nonebot
|
|
|
|
from nonebot.adapters.onebot import v11, v12
|
2024-03-24 21:21:57 +08:00
|
|
|
from liteyuki.utils.config import config, load_from_yaml
|
2024-03-24 09:43:34 +08:00
|
|
|
from liteyuki.utils import init
|
2024-03-25 12:55:16 +08:00
|
|
|
from liteyuki.utils.liteyuki_api import liteyuki_api
|
2024-03-23 19:55:12 +08:00
|
|
|
|
2024-03-24 09:43:34 +08:00
|
|
|
init()
|
2024-03-19 13:16:25 +08:00
|
|
|
nonebot.init(**load_from_yaml("config.yml"))
|
2024-03-18 18:21:56 +08:00
|
|
|
|
|
|
|
adapters = [v11.Adapter, v12.Adapter]
|
|
|
|
driver = nonebot.get_driver()
|
2024-03-23 19:55:12 +08:00
|
|
|
|
2024-03-18 18:21:56 +08:00
|
|
|
for adapter in adapters:
|
|
|
|
driver.register_adapter(adapter)
|
|
|
|
|
2024-03-24 09:43:34 +08:00
|
|
|
nonebot.load_plugin("liteyuki.liteyuki_main")
|
2024-03-18 18:21:56 +08:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2024-03-25 12:55:16 +08:00
|
|
|
try:
|
|
|
|
nonebot.run()
|
|
|
|
except BaseException as e:
|
2024-03-27 08:03:19 +08:00
|
|
|
# 排除键盘中断
|
|
|
|
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__()))
|