-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbot.py
More file actions
44 lines (33 loc) · 1.03 KB
/
Copy pathbot.py
File metadata and controls
44 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict
import nonebot
from nonebot.adapters.onebot.v11 import Adapter, Message, MessageSegment
from nonebot.adapters.qq import Adapter as QQAdapter
from nonebot import require, get_bot, get_driver
# Custom your logger
#
from nonebot.log import logger, default_format
logger.add("error.log",
rotation="00:00",
diagnose=False,
level="ERROR",
format=default_format)
# You can pass some keyword args config to init function
nonebot.init()
# nonebot.load_builtin_plugins()
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter(Adapter)
driver.register_adapter(QQAdapter)
driver.config.help_text = {}
import src.quart
driver.server_app.mount("/web", src.quart.quart_app)
nonebot.load_plugins("src/plugins")
nonebot.load_plugins("private/plugins")
# Modify some config / config depends on loaded configs
#
# config = driver.config
# do something...
if __name__ == "__main__":
nonebot.run(port=8000)