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

Method init

autorepeat/autorepeat.ts:234–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232 this.enabledGroups = new Set(settings);
233 }
234
235 // 加载每日记录
236 const data = await this.cache.getData();
237 if (data) {
238 if (data.last_day_check) {
239 this.lastDayCheck = data.last_day_check;
240 }
241 if (data.daily_history) {
242 for (const [gidStr, hashes] of Object.entries(data.daily_history)) {
243 const gid = Number(gidStr);
244 if (!Number.isNaN(gid)) {
245 this.dailyHistory.set(gid, new Set(hashes));
246 }
247 }
248 }
249 if (data.trigger_config) {
250 this.triggerConfig = data.trigger_config;
251 }
252 }
253 }
254
255 static async setTriggerConfig(timeWindow: number, minUsers: number) {
256 this.triggerConfig = { timeWindow, minUsers };
257 await this.cache.saveData({ trigger_config: this.triggerConfig });
258 }
259
260 static getTriggerConfig() {
261 return { ...this.triggerConfig };
262 }

Callers 1

autorepeat.tsFile · 0.45

Calls 3

getDataMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected