import nonebot
from nonebot.adapters.qq import Adapter as QQ
from nonebot.adapters.onebot.v11 import Adapter as Onebot
from nonebot.log import logger

# 初始化 NoneBot 以及 数据库
nonebot.init()
app = nonebot.get_asgi()

# 注册适配器
driver = nonebot.get_driver()
driver.register_adapter(QQ)
driver.register_adapter(Onebot)

# 加载自定义插件
nonebot.load_plugins("src/plugins")  # 加载bot自定义插件

# 加载配置文件中的插件
nonebot.load_from_toml("pyproject.toml")

if __name__ == "__main__":
    logger.warning("Bot启动")
    nonebot.run()
