MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / maintenance

Method maintenance

autorepeat/autorepeat.ts:392–413  ·  view source on GitHub ↗
(now: number)

Source from the content-addressed store, hash-verified

390 const valid = msgs.filter(m => now - m.time <= this.triggerConfig.timeWindow);
391 if (valid.length === 0) {
392 this.recentMessages.delete(gid);
393 } else {
394 this.recentMessages.set(gid, valid);
395 }
396 }
397 this.lastCleanup = now;
398 }
399
400 // 每天重置复读记录
401 const dayKey = Math.floor((now + 8 * 3600) / 86400); // UTC+8 天数
402 if (dayKey > this.lastDayCheck) {
403 this.dailyHistory.clear();
404 this.lastDayCheck = dayKey;
405 this.saveDailyHistory(); // 保存新的天数和空的记录
406 }
407 }
408
409 static cleanup(): void {
410 this.recentMessages.clear();
411 this.dailyHistory.clear();
412 this.enabledGroups.clear();
413 this.lastCleanup = 0;
414 this.lastDayCheck = 0;
415 }
416}

Callers 1

checkAndRepeatMethod · 0.95

Calls 4

saveDailyHistoryMethod · 0.95
clearMethod · 0.80
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected