summaryrefslogtreecommitdiff
path: root/ATRI/configs/create.py
diff options
context:
space:
mode:
author0w0 <[email protected]>2023-06-19 18:56:21 +0800
committerGitHub <[email protected]>2023-06-19 18:56:21 +0800
commit54f293858cf145a76253f9573985740915a3b9dc (patch)
treee8acc68b2f755406cf64a8249d73cf2114c2773f /ATRI/configs/create.py
parentb82f6128fc828a3066c620919cab557df1efa9a5 (diff)
parent3719db1dab050928417757c498edfc673501bad9 (diff)
downloadATRI-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/configs/create.py')
-rw-r--r--ATRI/configs/create.py9
1 files changed, 6 insertions, 3 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)