From 389a1649f40cf649738eeead3c209071d55bd3e7 Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Thu, 3 Feb 2022 16:30:13 +0800 Subject: =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20=E7=BB=99=E4=BA=88=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E9=83=A8=E7=BD=B2=E5=8F=AF=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/__init__.py | 5 +++-- ATRI/config.py | 1 + config.yml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ATRI/__init__.py b/ATRI/__init__.py index 5346a7a..2ba9e35 100644 --- a/ATRI/__init__.py +++ b/ATRI/__init__.py @@ -3,7 +3,7 @@ from time import sleep import nonebot from nonebot.adapters.onebot.v11 import Adapter -from .config import RUNTIME_CONFIG +from .config import RUNTIME_CONFIG, InlineGoCQHTTP __version__ = "YHN-001-A05" @@ -20,7 +20,8 @@ def init(): nonebot.init(**RUNTIME_CONFIG) driver().register_adapter(Adapter) nonebot.load_plugins("ATRI/plugins") - nonebot.load_plugin("nonebot_plugin_gocqhttp") + if InlineGoCQHTTP.enabled: + nonebot.load_plugin("nonebot_plugin_gocqhttp") sleep(3) diff --git a/ATRI/config.py b/ATRI/config.py index bbd5354..66e65fc 100644 --- a/ATRI/config.py +++ b/ATRI/config.py @@ -33,6 +33,7 @@ class BotSelfConfig: class InlineGoCQHTTP: config: dict = config["InlineGoCQHTTP"] + enabled: bool = bool(config.get("enabled", True)) accounts: list = config.get("accounts", []) download_version: str = str(config.get("download_version", "latest")) diff --git a/config.yml b/config.yml index 0ff3f14..388271c 100644 --- a/config.yml +++ b/config.yml @@ -10,6 +10,7 @@ BotSelfConfig: proxy: "" # 请参考文档 InlineGoCQHTTP: + enabled: true accounts: # 可多个账号,具体请参考文档 - uin: 1234567890 password: "" -- cgit v1.2.3