23 lines
490 B
Python
23 lines
490 B
Python
import nonebot
|
|
from nonebot.adapters.qq import Adapter as QQ
|
|
from nonebot.log import logger
|
|
|
|
# 初始化 NoneBot 以及 数据库
|
|
nonebot.init()
|
|
app = nonebot.get_asgi()
|
|
|
|
# 注册适配器
|
|
driver = nonebot.get_driver()
|
|
driver.register_adapter(QQ)
|
|
|
|
|
|
# 加载自定义插件
|
|
nonebot.load_plugins("src/plugins") # 加载bot自定义插件
|
|
|
|
# 加载配置文件中的插件
|
|
nonebot.load_from_toml("pyproject.toml")
|
|
|
|
if __name__ == "__main__":
|
|
logger.warning("Bot启动")
|
|
nonebot.run()
|