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

Method runSingleSign

checkin/checkin.ts:446–469  ·  view source on GitHub ↗
(target: SignTarget)

Source from the content-addressed store, hash-verified

444 if (!conf.runTimeEnd) return null;
445 if (this.todayRunTime) return this.todayRunTime;
446
447 const [startH, startM] = conf.runTime.split(":").map(Number);
448 const [endH, endM] = conf.runTimeEnd.split(":").map(Number);
449
450 const startMinutes = startH * 60 + startM;
451 let endMinutes = endH * 60 + endM;
452
453 if (endMinutes < startMinutes) {
454 endMinutes += 24 * 60;
455 }
456
457 if (endMinutes <= startMinutes) {
458 return conf.runTime;
459 }
460
461 const randomMinute = startMinutes + Math.floor(Math.random() * (endMinutes - startMinutes));
462 const finalMinutes = randomMinute >= 24 * 60 ? randomMinute - 24 * 60 : randomMinute;
463 const hours = Math.floor(finalMinutes / 60);
464 const minutes = finalMinutes % 60;
465
466 return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
467 }
468
469 private async runAllSigns(source: string, fallbackPeer?: any, statusMsg?: Api.Message): Promise<void> {
470 const client = await getGlobalClient();
471 if (!client) return;
472 const conf = this.cfg.get();

Callers 2

handleTargetCommandMethod · 0.95
runAllSignsMethod · 0.95

Calls 5

waitForNewMessageMethod · 0.95
hasMatcherMethod · 0.95
findCallbackButtonMethod · 0.95
isAfterMessageMethod · 0.95
clickCallbackButtonMethod · 0.95

Tested by

no test coverage detected