!71 首次启动或修改账号时可配置签名API

Merge pull request !71 from 千奈千祁/N/A
This commit is contained in:
Kokomi 2023-08-06 06:44:49 +00:00 committed by Gitee
commit d3c2da6bdb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,11 @@ export default async function createQQ () {
name: 'masterQQ' name: 'masterQQ'
}) })
} }
propmtList.push({
type: 'input',
message: '请输入签名API地址可留空',
name: 'signAPI'
})
const ret = await inquirer.prompt(propmtList) const ret = await inquirer.prompt(propmtList)
let file = './config/config/' let file = './config/config/'
@ -82,6 +87,10 @@ export default async function createQQ () {
fs.writeFileSync(`${file}other.yaml`, other, 'utf8') fs.writeFileSync(`${file}other.yaml`, other, 'utf8')
} }
if (ret.signAPI) {
bot = bot.replace(/sign_api_addr:\s*/, `sign_api_addr: ${ret.signAPI}`);
}
fs.writeFileSync(`${file}bot.yaml`, bot, 'utf8') fs.writeFileSync(`${file}bot.yaml`, bot, 'utf8')
console.log(`\nQQ配置完成正在登录\n后续修改账号可以运行命令: ${chalk.green('node app login')}\n`) console.log(`\nQQ配置完成正在登录\n后续修改账号可以运行命令: ${chalk.green('node app login')}\n`)