MCPcopy Create free account
hub / github.com/6dylan6/jdpro / putMsg

Method putMsg

function/magic.js:369–391  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

367 }
368
369 putMsg(msg) {
370 msg += ''
371 this.log(msg)
372 let r = [[' ', ''], ['优惠券', '券'], ['东券', '券'], ['店铺', ''],
373 ['恭喜', ''], ['获得', '']]
374 for (let ele of r) {
375 msg = msg.replace(ele[0], ele[1])
376 }
377 if (this.bot) {
378 this.msg.push(msg)
379 } else {
380 let username = this.accounts[this.username] || this.username;
381 username += this.index
382 if (this.msg.length > 0 && this.msg[this.msg.length - 1].includes(
383 username)) {
384 this.msg[this.msg.length - 1] = this.msg[this.msg.length
385 - 1].split(" ")[0] + '' + [this.msg[this.msg.length - 1].split(
386 " ")[1], msg].join(',')
387 } else {
388 this.msg.push(`【${username}】${msg}`)
389 }
390 }
391 }
392
393 md5(str) {
394 return CryptoJS.MD5(str).toString()

Callers

nothing calls this directly

Calls 1

logMethod · 0.95

Tested by

no test coverage detected