mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-17 03:20:54 +00:00
💥 remove builtin adapter auto register
This commit is contained in:
@ -4,6 +4,7 @@ import sys
|
||||
sys.path.insert(0, os.path.abspath(".."))
|
||||
|
||||
import nonebot
|
||||
from nonebot.adapters.cqhttp import Bot
|
||||
from nonebot.log import logger, default_format
|
||||
|
||||
# test custom log
|
||||
@ -15,6 +16,8 @@ logger.add("error.log",
|
||||
|
||||
nonebot.init(custom_config2="config on init")
|
||||
app = nonebot.get_asgi()
|
||||
driver = nonebot.get_driver()
|
||||
driver.register_adapter("cqhttp", Bot)
|
||||
|
||||
# load builtin plugin
|
||||
nonebot.load_builtin_plugins()
|
||||
@ -25,7 +28,7 @@ nonebot.load_plugins("test_plugins")
|
||||
print(nonebot.require("test_export"))
|
||||
|
||||
# modify some config / config depends on loaded configs
|
||||
config = nonebot.get_driver().config
|
||||
config = driver.config
|
||||
config.custom_config3 = config.custom_config1
|
||||
config.custom_config4 = "New custom config"
|
||||
|
||||
|
Reference in New Issue
Block a user