Skip to content

Commit

Permalink
增加环境变量
Browse files Browse the repository at this point in the history
  • Loading branch information
hex-ci committed Nov 25, 2023
1 parent 147a910 commit f46522d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ql repo https://github.com/hex-ci/smzdm_script.git "smzdm_" "" "env.js|bot.js|se
* `SMZDM_COMMENT`: 如果要完成评论文章的任务请设置这个环境变量,环境变量的内容是评论的文案,文案要大于 10 个汉字,建议用比较个性化的文案,脚本发布评论后会删除这条评论,但是为防止删除失败的情况,请尽量用好一点的文案,防止被判定为恶意灌水。
* `SMZDM_CROWD_SILVER_5`: 每日抽奖任务默认只进行免费抽奖,如要进行 5 碎银子的抽奖,请设置这个环境变量的值为 `yes`
* `SMZDM_CROWD_KEYWORD`: 抽奖关键词,执行非免费抽奖时,会优先选择包含此关键词的抽奖,如果未找到包含此关键词的抽奖,则会随机选择一个。
* `SMZDM_TASK_TESTING`: 是否运行全民众测能量值任务,如要运行此任务,请设置这个环境变量的值为 `yes`,否则不运行。

## 交流群

Expand Down
6 changes: 6 additions & 0 deletions smzdm_testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ class SmzdmTestingTaskBot extends SmzdmTaskBot {
}

!(async () => {
if (process.env.SMZDM_TASK_TESTING != 'yes') {
$.log('🟡请设置 SMZDM_TASK_TESTING 环境变量值为 yes 后才能运行全民众测能量值任务!');

return;
}

const cookies = getEnvCookies();

if (cookies === false) {
Expand Down

0 comments on commit f46522d

Please sign in to comment.