HeXi/bot.py
sansenhoshi 275f05ee4a 重构
2026-01-04 17:15:40 +08:00

24 lines
674 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import nonebot
from nonebot.adapters.onebot.v11 import Adapter as ONEBOTV11Adapter
from nonebot.log import logger
from sqlalchemy import StaticPool
# 初始化 NoneBot 以及 数据库
nonebot.init(datastore_engine_options={"poolclass": StaticPool})
# 注册适配器
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter(ONEBOTV11Adapter)
# driver.register_adapter(minecraftAdapter)
# 加载自定义插件
nonebot.load_plugins("hexi") # 加载bot自定义插件
# 加载配置文件中的插件
nonebot.load_from_toml("pyproject.toml")
if __name__ == "__main__":
logger.warning("hexi启动")
nonebot.run(app="__mp_main__:app")