默认不做评论文章的任务

This commit is contained in:
Hex
2023-04-12 10:27:20 +08:00
parent 8e1bc3b5d3
commit c8568b1204
2 changed files with 11 additions and 5 deletions

View File

@@ -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) {