fix: 低版本node(< v15)不支持replaceAll

Nodejs v15 has V8 8.6 and thus that's the
 first nodejs version where you can use .replaceAll()
This commit is contained in:
shanmite 2022-02-04 10:18:20 +08:00
parent 6dbb9854c8
commit f569207dc5

View File

@ -421,7 +421,7 @@ class Monitor extends Searcher {
let let
/**转发评语 */ /**转发评语 */
RandomStr = getRandomOne(relays) RandomStr = getRandomOne(relays)
.replaceAll('${uname}', uname_map[real_uid] || uname), .replace(/\$\{uname\}/g, uname_map[real_uid] || uname),
/**控制字段 */ /**控制字段 */
new_ctrl = []; new_ctrl = [];
@ -481,7 +481,7 @@ class Monitor extends Searcher {
if (isSendChat) { if (isSendChat) {
onelotteryinfo.rid = rid onelotteryinfo.rid = rid
onelotteryinfo.chat = getRandomOne(chats) onelotteryinfo.chat = getRandomOne(chats)
.replaceAll('${uname}', uname_map[real_uid] || uname) .replace(/\$\{uname\}/g, uname_map[real_uid] || uname)
} }
alllotteryinfo.push(onelotteryinfo); alllotteryinfo.push(onelotteryinfo);