node-karin 0.8.13 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/core/listener.js
CHANGED
|
@@ -68,6 +68,11 @@ class Listeners extends EventEmitter {
|
|
|
68
68
|
const { id, contact, time, message_id } = options
|
|
69
69
|
/** 重启花费时间 保留2位小数 */
|
|
70
70
|
const restartTime = ((Date.now() - time) / 1000).toFixed(2)
|
|
71
|
+
/** 超过2分钟不发 */
|
|
72
|
+
if (Number(restartTime) > 120) {
|
|
73
|
+
await level.del(key)
|
|
74
|
+
return false
|
|
75
|
+
}
|
|
71
76
|
const element = [
|
|
72
77
|
segment.reply(message_id),
|
|
73
78
|
segment.text(`Karin 重启成功:${restartTime}秒`),
|