From 8c849babc3e6ebd62c3759139057ba0fe8f87127 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Tue, 31 Jan 2023 04:10:00 +0000 Subject: =?UTF-8?q?:rotating=5Flight:=20=E8=87=AA=E5=8A=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/configs/create.py | 31 +++++++++++-------------------- ATRI/configs/data_source.py | 2 +- 2 files changed, 12 insertions(+), 21 deletions(-) (limited to 'ATRI') 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) -- cgit v1.2.3