diff options
author | 0w0 <[email protected]> | 2023-06-19 18:56:21 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-19 18:56:21 +0800 |
commit | 54f293858cf145a76253f9573985740915a3b9dc (patch) | |
tree | e8acc68b2f755406cf64a8249d73cf2114c2773f /ATRI | |
parent | b82f6128fc828a3066c620919cab557df1efa9a5 (diff) | |
parent | 3719db1dab050928417757c498edfc673501bad9 (diff) | |
download | ATRI-54f293858cf145a76253f9573985740915a3b9dc.tar.gz ATRI-54f293858cf145a76253f9573985740915a3b9dc.tar.bz2 ATRI-54f293858cf145a76253f9573985740915a3b9dc.zip |
🔀 Merge pull request #90 from yangrq1018/main
fix invalid yaml format when is_use_with_gocq is False
Diffstat (limited to 'ATRI')
-rw-r--r-- | ATRI/configs/create.py | 9 | ||||
-rw-r--r-- | ATRI/configs/default_config.yml | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ATRI/configs/create.py b/ATRI/configs/create.py index f1be942..1eff69b 100644 --- a/ATRI/configs/create.py +++ b/ATRI/configs/create.py @@ -93,12 +93,15 @@ def init_config(conf_path: Path, default_conf_path: Path): if is_use_with_gocq: raw_conf = raw_conf.replace("{is_use_with_gocq}", "true") - raw_conf = raw_conf.replace("{uin}", str(uin)) # type: ignore - raw_conf = raw_conf.replace("{password}", password) # type: ignore - raw_conf = raw_conf.replace("{protocol}", str(protocol)) # type: ignore raw_conf = raw_conf.replace("{download_domain}", download_domain) # type: ignore + raw_conf = raw_conf.replace("{accounts}", """ + - uin: {uin} + password: "{password}" + protocol: {protocol}""". + format(uin=str(uin), password=password, protocol=str(protocol))) # type: ignore else: raw_conf = raw_conf.replace("{is_use_with_gocq}", "false") + raw_conf = raw_conf.replace("{account}", "[]") raw_conf = raw_conf.replace("{saucenao_key}", saucenao_key) diff --git a/ATRI/configs/default_config.yml b/ATRI/configs/default_config.yml index 7808487..daa7ca8 100644 --- a/ATRI/configs/default_config.yml +++ b/ATRI/configs/default_config.yml @@ -16,10 +16,7 @@ BotConfig: WithGoCQHTTP: enabled: {is_use_with_gocq} - accounts: - - uin: {uin} - password: "{password}" - protocol: {protocol} + accounts: {accounts} download_domain: "{download_domain}" download_version: "v1.0.0-rc4" |