summaryrefslogtreecommitdiff
path: root/ATRI/configs
diff options
context:
space:
mode:
authorLint Action <[email protected]>2023-01-31 04:10:00 +0000
committerLint Action <[email protected]>2023-01-31 04:10:00 +0000
commit8c849babc3e6ebd62c3759139057ba0fe8f87127 (patch)
treeac33c784a3a14a7c221dbfde9b61a1207e342aaa /ATRI/configs
parent3ae7efc11d839bccf42ee0ca4370b10b3a7eef9b (diff)
downloadATRI-8c849babc3e6ebd62c3759139057ba0fe8f87127.tar.gz
ATRI-8c849babc3e6ebd62c3759139057ba0fe8f87127.tar.bz2
ATRI-8c849babc3e6ebd62c3759139057ba0fe8f87127.zip
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/configs')
-rw-r--r--ATRI/configs/create.py31
-rw-r--r--ATRI/configs/data_source.py2
2 files changed, 12 insertions, 21 deletions
diff --git a/ATRI/configs/create.py b/ATRI/configs/create.py
index 84ca9a3..deed5bb 100644
--- a/ATRI/configs/create.py
+++ b/ATRI/configs/create.py
@@ -32,63 +32,54 @@ def init_config(conf_path: Path, default_conf_path: Path):
"超级用户 (qq号), 即 Bot 的[b]主人[/b]. 可填多个, 用英文逗号 (,) 隔开 (默认: [green]1145141919[/green])",
"1145141919810",
str,
- "输入不正确 示例: 1145141919"
+ "输入不正确 示例: 1145141919",
)
access_token = console.input(
"协议端通信密钥, 此项留空[b]将无法进入控制台[/b]. 无长度限制 示例: [green]21^sASDA!@3l67GJlk7sd!14#[/green]",
str(),
str,
- "输入不正确 示例: 21^sASDA!@3l67GJlk7sd!14# (请尽可能复杂, 无长度限制)"
+ "输入不正确 示例: 21^sASDA!@3l67GJlk7sd!14# (请尽可能复杂, 无长度限制)",
)
proxy = console.input(
"是否有代理. 格式参考: http(s)://127.0.0.1:8100 (如无请 Enter 以跳过)",
str(),
str,
- "输入不正确 示例: http://127.0.0.1:8100"
+ "输入不正确 示例: http://127.0.0.1:8100",
)
console.success("Bot 主体配置完成\n")
console.info("[b]Bot 进阶设置[/b]\n", style="white")
is_use_with_gocq = console.input(
- "是否启用内置的 gocqhttp? (y/n) (默认: y)",
- "y",
- str,
- "输入不正确 示例: y"
+ "是否启用内置的 gocqhttp? (y/n) (默认: y)", "y", str, "输入不正确 示例: y"
)
if is_use_with_gocq in ["y", "Y", "true", "True", "是"]:
- uin = console.input(
- "Bot 账号",
- str(),
- int,
- "输入不正确 示例: 1145141919"
- )
+ uin = console.input("Bot 账号", str(), int, "输入不正确 示例: 1145141919")
password = console.input(
"Bot 账号密码 (已做隐藏处理, 如不确定是否填写正确, 请查阅填写完毕后所生成的文件: config.yml)",
str(),
str,
- password=True
+ password=True,
)
protocol = console.input(
"Bot 登录设备类型. 范围: 0-5, 具体请参考文档: 部署项目-设置 (默认: 5)",
"5",
int,
- "输入不正确 范围 0-5 示例: 5"
+ "输入不正确 范围 0-5 示例: 5",
)
download_domain = console.input(
- "gocqhttp 下载源域名设置. 具体请参考文档: 部署项目-设置 (默认: github.com)",
- "github.com"
+ "gocqhttp 下载源域名设置. 具体请参考文档: 部署项目-设置 (默认: github.com)", "github.com"
)
is_use_with_gocq = True
console.success("内置 gocqhttp 配置完成. 支持多账号, 具体请参考文档: 部署项目-设置\n")
else:
is_use_with_gocq = False
console.info("已跳过\n")
-
+
console.info("[b]Bot 插件设置[/b]\n", style="white")
saucenao_key = console.input(
"SauceNAO 搜图密钥, 如不填写将无法启用[b]以图搜图[/b], 前往官网以获取: https://saucenao.com/ (默认: 空)",
str(),
- str
+ str,
)
console.success("[white]至此, 所需基本配置已填写完毕[white]")
@@ -108,7 +99,7 @@ def init_config(conf_path: Path, default_conf_path: Path):
raw_conf = raw_conf.replace("{download_domain}", download_domain) # type: ignore
else:
raw_conf = raw_conf.replace("{is_use_with_gocq}", "false")
-
+
raw_conf = raw_conf.replace("{saucenao_key}", saucenao_key)
with open(conf_path, "w", encoding="utf-8") as w:
diff --git a/ATRI/configs/data_source.py b/ATRI/configs/data_source.py
index 8794223..f0fda2c 100644
--- a/ATRI/configs/data_source.py
+++ b/ATRI/configs/data_source.py
@@ -9,7 +9,7 @@ class Console(C):
def info(self, content: str, *args, **kwargs):
text = "[blue][¡][/blue] " + content
self.console.print(text, *args, **kwargs)
-
+
def success(self, content: str, *args, **kwargs):
text = "[green][√][/green] " + content
self.console.print(text, *args, **kwargs)