对V3下的MysInfo错误信息增加频度控制

This commit is contained in:
yoimiya-kokomi 2022-09-01 02:35:47 +08:00
parent 4f3cd1c93f
commit b8a5d29aae

View File

@ -47,7 +47,18 @@ class Mys {
if (!this.MysApi) {
return false
}
let e = this.e
// 防止错误信息刷屏
e._original_reply = e._original_reply || e.reply
e.reply = function (msg) {
if (!e._isReplyed) {
e._isReplyed = true
e.reply = e._original_reply
return e._original_reply(msg)
}
}
let ret = await MysInfo.get(this.e, api, data)
e.reply = e._original_reply
if (!ret) {
return false
}