mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
parent
484f2e9ba9
commit
2fbd292e7a
@ -223,8 +223,9 @@ class Monitor extends Searcher {
|
||||
* @property {boolean} isOfficialLottery 是否官方抽奖
|
||||
* @property {string} relay_chat 转发词
|
||||
* @property {string} ctrl 定位@
|
||||
* @property {string} rid 评论标识
|
||||
* @property {string} [rid] 评论标识
|
||||
* @property {number} chat_type 评论类型
|
||||
* @property {string} [chat] 评论词
|
||||
*/
|
||||
/**
|
||||
* @returns {Promise<LotteryOptions[]>}
|
||||
@ -244,7 +245,7 @@ class Monitor extends Searcher {
|
||||
/** 所有抽奖信息 */
|
||||
let alllotteryinfo = [];
|
||||
const
|
||||
{ check_if_duplicated, set_lottery_info_url, sneaktower, key_words, model, chatmodel, block_dynamic_type, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist, use_public_blacklist } = config,
|
||||
{ check_if_duplicated, set_lottery_info_url, sneaktower, key_words, model, chatmodel, chat: chats, relay: relays, block_dynamic_type, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist, use_public_blacklist } = config,
|
||||
now_ts = Date.now() / 1000;
|
||||
|
||||
/**
|
||||
@ -403,6 +404,7 @@ class Monitor extends Searcher {
|
||||
}
|
||||
|
||||
if (isLottery) {
|
||||
const { uname_map = {} } = global_var.get("remoteconfig")
|
||||
let onelotteryinfo = {};
|
||||
|
||||
onelotteryinfo.isOfficialLottery = hasOfficialLottery;
|
||||
@ -418,7 +420,8 @@ class Monitor extends Searcher {
|
||||
|
||||
let
|
||||
/**转发评语 */
|
||||
RandomStr = getRandomOne(config.relay),
|
||||
RandomStr = getRandomOne(relays)
|
||||
.replaceAll('${uname}', uname_map[real_uid] || uname),
|
||||
/**控制字段 */
|
||||
new_ctrl = [];
|
||||
|
||||
@ -475,7 +478,11 @@ class Monitor extends Searcher {
|
||||
: 0;
|
||||
|
||||
/* 是否评论 */
|
||||
if (isSendChat) onelotteryinfo.rid = rid;
|
||||
if (isSendChat) {
|
||||
onelotteryinfo.rid = rid
|
||||
onelotteryinfo.chat = getRandomOne(chats)
|
||||
.replaceAll('${uname}', uname_map[real_uid] || uname)
|
||||
}
|
||||
|
||||
alllotteryinfo.push(onelotteryinfo);
|
||||
} else {
|
||||
@ -520,8 +527,8 @@ class Monitor extends Searcher {
|
||||
|
||||
let status = 0
|
||||
const
|
||||
{ uid, dyid, chat_type, rid, relay_chat, ctrl } = option,
|
||||
{ chat, check_if_duplicated, is_repost_then_chat } = config;
|
||||
{ uid, dyid, chat_type, rid, relay_chat, ctrl, chat } = option,
|
||||
{ check_if_duplicated, is_repost_then_chat } = config;
|
||||
|
||||
/* 评论 */
|
||||
if (rid && chat_type) {
|
||||
@ -531,7 +538,7 @@ class Monitor extends Searcher {
|
||||
[1, 4],
|
||||
() => bili.sendChat(
|
||||
rid,
|
||||
is_repost_then_chat ? relay_chat : getRandomOne(chat),
|
||||
is_repost_then_chat ? relay_chat : chat,
|
||||
chat_type
|
||||
)
|
||||
)
|
||||
|
||||
@ -303,12 +303,12 @@ const utils = {
|
||||
if (body.node_msg) utils.log.info('公告', '\n' + body.node_msg + '\n');
|
||||
resolve(body.config)
|
||||
} catch (error) {
|
||||
resolve(JSON.parse('{}'))
|
||||
resolve({})
|
||||
}
|
||||
},
|
||||
failure: err => {
|
||||
utils.log.error('获取远程设置', '获取远程设置错误: ' + err);
|
||||
resolve(JSON.parse('{}'));
|
||||
resolve({})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@ -289,11 +289,15 @@ module.exports = Object.freeze({
|
||||
|
||||
/**
|
||||
* 转发评语
|
||||
* 支持变量${uname}
|
||||
*/
|
||||
relay: ['转发动态'],
|
||||
|
||||
/**
|
||||
* 评论内容
|
||||
* 支持变量${uname}
|
||||
* @example
|
||||
* "祝${uname}早日百大!"
|
||||
*/
|
||||
chat: [
|
||||
'[OK]', '[星星眼]', '[歪嘴]', '[喜欢]', '[偷笑]', '[笑]', '[喜极而泣]', '[辣眼睛]', '[吃瓜]', '[奋斗]',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user