lintonxue00 commited on
Commit
8dd0e52
1 Parent(s): da58c8a

Upload bot.py

Browse files
Files changed (1) hide show
  1. 不知道/回收站/5/bot.py +21 -0
不知道/回收站/5/bot.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import nonebot
2
+ from nonebot.adapters.onebot.v11 import Adapter
3
+ from services.db_context import init, disconnect
4
+
5
+ nonebot.init()
6
+ driver = nonebot.get_driver()
7
+ driver.register_adapter(Adapter)
8
+ config = driver.config
9
+ driver.on_startup(init)
10
+ driver.on_shutdown(disconnect)
11
+ # 优先加载定时任务
12
+ nonebot.load_plugin("nonebot_plugin_apscheduler")
13
+ nonebot.load_plugins("basic_plugins")
14
+ nonebot.load_plugins("plugins")
15
+ nonebot.load_plugins("extensive_plugin")
16
+ # 最后加载权限控制
17
+ nonebot.load_plugins("basic_plugins/hooks")
18
+
19
+
20
+ if __name__ == "__main__":
21
+ nonebot.run()