mirror of
https://github.com/hex-ci/smzdm_script.git
synced 2026-02-02 18:48:52 +08:00
默认不做评论文章的任务
This commit is contained in:
@@ -48,6 +48,7 @@ ql repo https://github.com/hex-ci/smzdm_script.git "" "env.js|bot.js|sendNotify.
|
||||
|
||||
* SMZDM_COOKIE: 抓包抓到的 Cookie 内容,需要所有 Cookie 内容,多用户可以用 `&` 分隔,或者使用多个同名环境变量。
|
||||
* SMZDM_SK: 这个值是可选值,是从安卓 App 的 `https://user-api.smzdm.com/checkin` 请求参数中抓包抓到的,如果抓到这个值可以填写(强烈建议填写),如果没抓到可以忽略,多用户可以用 `&` 分隔,或者使用多个同名环境变量,顺序要保持与 `SMZDM_COOKIE` 多用户顺序一致。
|
||||
* SMZDM_COMMENT: 如果要完成评论文章的任务请设置这个环境变量,环境变量的内容是评论的文案,文案要大于 10 个汉字,建议用比较个性化的文案,这个评论脚本发布后会删除,但是为防止删除失败的情况,请尽量用好一点的文案,防止被判定为恶意灌水。
|
||||
|
||||
## 交流群
|
||||
|
||||
|
||||
@@ -121,12 +121,17 @@ class SmzdmTaskBot extends SmzdmBot {
|
||||
}
|
||||
// 评论任务
|
||||
else if (task.task_event_type == 'interactive.comment') {
|
||||
const { isSuccess } = await this.doCommentTask(task);
|
||||
if (process.env.SMZDM_COMMENT && String(process.env.SMZDM_COMMENT).length > 10) {
|
||||
const { isSuccess } = await this.doCommentTask(task);
|
||||
|
||||
notifyMsg += this.getTaskNotifyMessage(isSuccess, task);
|
||||
notifyMsg += this.getTaskNotifyMessage(isSuccess, task);
|
||||
|
||||
$.log('等候 5 秒');
|
||||
await $.wait(5000);
|
||||
$.log('等候 5 秒');
|
||||
await $.wait(5000);
|
||||
}
|
||||
else {
|
||||
$.log('请设置 SMZDM_COMMENT 环境变量后才能做评论任务!');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,7 +182,7 @@ class SmzdmTaskBot extends SmzdmBot {
|
||||
const {isSuccess, data } = await this.submitComment({
|
||||
articleId: article.article_id,
|
||||
channelId: article.article_channel_id,
|
||||
content: '感谢作者写的文章,阅读这篇文章后,感觉作者写的挺不错的~'
|
||||
content: process.env.SMZDM_COMMENT
|
||||
});
|
||||
|
||||
if (!isSuccess) {
|
||||
|
||||
Reference in New Issue
Block a user