feat: 新增设置is_repost_then_chat(#103)

转发并评论
This commit is contained in:
shanmite 2022-01-05 18:13:48 +08:00
parent 7496bc58a8
commit ae34c691b1
3 changed files with 18 additions and 2 deletions

View File

@ -519,7 +519,7 @@ class Monitor extends Searcher {
let status = 0
const
{ uid, dyid, chat_type, rid, relay_chat, ctrl } = option,
{ chat, check_if_duplicated } = config;
{ chat, check_if_duplicated, is_repost_then_chat } = config;
/* 评论 */
if (rid && chat_type) {
@ -527,7 +527,11 @@ class Monitor extends Searcher {
status = await retryfn(
5,
[1, 4],
() => bili.sendChat(rid, getRandomOne(chat), chat_type)
() => bili.sendChat(
rid,
is_repost_then_chat ? relay_chat : getRandomOne(chat),
chat_type
)
)
if (status) {

View File

@ -260,6 +260,12 @@ const config = {
*/
blockword: ["脚本", "抽奖号", "钓鱼"],
/**
* 转发并评论
* - 评论内容与转发内容相同
*/
is_repost_then_chat: false,
/**
* 转发评语
*/

View File

@ -275,6 +275,12 @@ module.exports = Object.freeze({
*/
blockword: ["脚本", "抽奖号", "钓鱼"],
/**
* 转发并评论
* - 评论内容与转发内容相同
*/
is_repost_then_chat: false,
/**
* 转发评语
*/