diff --git a/README.md b/README.md index a111b07..9bdf6f9 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,25 @@ Chrome浏览器: 3. 在`env.js`中填入`COOKIE`和推送参数 4. 在`my_config.js`中自定义设置 5. 在当前目录下**打开终端**运行可执行文件`lottery`(勿直接点击`lottery`) - - `lottery start` 启动抽奖 - - `lottery check` 检测中奖 - - `lottery clear` 清理动态 + ```sh + # unix-like + ## 进入脚本所在目录 + ## 授予执行权限 + $ chmod u+x lottery + ## 启动脚本 + $ ./lottery start + ## 检测中奖 + $ ./lottery check + ## 清理关注动态 + $ ./lottery clear + ## 下载最新版本 + $ ./lottery clear - 或者 新建文本文档写入`lottery start`然后更改扩展名为.bat点击运行(已自带start.bat可直接点击) + # windows + ## 不需要chmod + ## 把`./`换成`.\`或去掉 + ## 已自带*.bat可直接点击 + ``` 7. 运行截图 ![lottery_start](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/lottery_start.png) @@ -177,12 +191,12 @@ npm i && npm run clear 1.初始化 ```bash -curl -fsSL https://cdn.staticaly.com/gh/shanmiteko/LotteryAutoScript/main/script/docker/init.sh | sh +$ curl -fsSL https://cdn.staticaly.com/gh/shanmiteko/LotteryAutoScript/main/script/docker/init.sh | sh ``` 进入`lottery`文件夹 ```bash -cd lottery +$ cd lottery ``` 编辑`env.js`与`my_config.js`文件 @@ -194,7 +208,7 @@ cd lottery 例如: ```bash -./start.sh +$ ./start.sh ``` 2.更新 @@ -208,8 +222,8 @@ cd lottery 进入lottery上一级目录 ```bash -docker image rm -f shanmite/lottery_auto_docker -rm -rf lottery/ +$ docker image rm -f shanmite/lottery_auto_docker +$ rm -rf lottery/ ``` ---------------------------------------- diff --git a/lib/core/monitor.js b/lib/core/monitor.js index a3dbf1d..ac6f03b 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -129,6 +129,8 @@ class Monitor extends Searcher { status = await this.go(Lottery) switch (status) { case 0: + case 9: + case 19: break; case 22: is_exception = true @@ -321,7 +323,9 @@ class Monitor extends Searcher { * @param {LotteryOptions} option * @returns {Promise} * 0 - 成功 + * 9 - 评论黑名单 * 11 - 评论错误 + * 19 - 关注黑名单 * 21 - 关注错误 * 22 - 关注异常 * 31 - 转发失败 diff --git a/lib/net/bili.js b/lib/net/bili.js index 2dc39ac..72577c9 100644 --- a/lib/net/bili.js +++ b/lib/net/bili.js @@ -572,6 +572,8 @@ const bili_client = { return [null, 0] case 22002: return ['您已被对方拉入黑名单', -1] + case 22003: + return ['黑名单用户无法关注', -1] case 22015: return ['账号异常', 2] default: @@ -867,7 +869,7 @@ const bili_client = { log.error('自动评论', '黑名单用户无法互动'); return -1; default: - log.error('自动评论', `评论失败\n${responseText}`); + log.error('自动评论', `未知错误\n${responseText}`); return 1; } }, diff --git a/package.json b/package.json index 0bdb72d..4864bc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lottery-auto-script", - "version": "2.2.4", + "version": "2.2.5", "description": "自动参与B站动态抽奖", "main": "main.js", "scripts": { diff --git a/script/unix-like/update.sh b/script/unix-like/update.sh new file mode 100644 index 0000000..3d51965 --- /dev/null +++ b/script/unix-like/update.sh @@ -0,0 +1,8 @@ +#!/bin/bash +./lottery update + +if [[ -r "latest_version.zip" ]]; then + unzip latest_version.zip + rm latest_version.zip + chmod u+x lottery +fi \ No newline at end of file