diff --git a/CHANGELOG.md b/CHANGELOG.md index 129e638..da0be32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## 主要变化(2.10.0) +* b74bb02 feat: ai 评论 (#462) + +_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_ + ## 主要变化(2.9.8) * c85c910 doc: 图片链接换源 * c4d37ed fix: Dockerfile.pkg-arm64换源 diff --git a/env.example.js b/env.example.js index 9d6109b..5195544 100644 --- a/env.example.js +++ b/env.example.js @@ -110,10 +110,9 @@ module.exports = Object.freeze({ * ai相关参数 */ ai_parm: { - //硅基流动apikey + //[硅基流动](https://siliconflow.cn/) apikey SILICON_FLOW_API_KEY:'', //提示词 PROMPT:'' - } }); diff --git a/lib/core/monitor.js b/lib/core/monitor.js index f9645f6..b46a25b 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -1,4 +1,4 @@ -const { log, hasEnv, shuffle, getRandomOne,getAiContent, delay, try_for_each, retryfn, appendLotteryInfoFile } = require('../utils'); +const { log, hasEnv, shuffle, getRandomOne, getAiContent, delay, try_for_each, retryfn, appendLotteryInfoFile } = require('../utils'); const { send } = require('../net/http'); const bili = require('../net/bili'); const { sendNotify } = require('../helper/notify'); @@ -281,7 +281,7 @@ class Monitor extends Searcher { reserve_lottery_wait, sneaktower, key_words, model, chatmodel, chat: chats, relay: relays, block_dynamic_type, max_create_time, is_imitator, - only_followed, at_users, blockword, blacklist,use_ai_comments + only_followed, at_users, blockword, blacklist, use_ai_comments } = config, now_ts = Date.now() / 1000; @@ -530,8 +530,7 @@ class Monitor extends Searcher { if (use_ai_comments) { try { log.info('开始获取Ai评论', `(https://t.bilibili.com/${dyid})`); - onelotteryinfo.chat = await getAiContent(lottery_info.des); - //(getRandomOne(chats) || '!!!').replace(/\$\{uname\}/g, uname); + onelotteryinfo.chat = await getAiContent(lottery_info.des) || '!!!'; log.info('Ai评论内容', `${onelotteryinfo.chat}`); } catch (e) { log.error('获取AI评论失败,使用随机评论', e); diff --git a/package.json b/package.json index 2f2815b..37936b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lottery-auto-script", - "version": "2.9.8", + "version": "2.10.0", "description": "自动参与B站动态抽奖", "main": "main.js", "scripts": { diff --git a/script/build/changelog.sh b/script/build/changelog.sh index b2a6ec6..88045f5 100644 --- a/script/build/changelog.sh +++ b/script/build/changelog.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # version: -level=patch +level=minor npm version $level \ --no-commit-hooks \