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
445 const startMinutes = startH * 60 + startM;
446 let endMinutes = endH * 60 + endM;
447
448 if (endMinutes < startMinutes) {
449 endMinutes += 24 * 60;
450 }
451
452 if (endMinutes <= startMinutes) {
453 return conf.runTime;
454 }
455
456 const randomMinute = startMinutes + Math.floor(Math.random() * (endMinutes - startMinutes));
457 const finalMinutes = randomMinute >= 24 * 60 ? randomMinute - 24 * 60 : randomMinute;
458 const hours = Math.floor(finalMinutes / 60);
459 const minutes = finalMinutes % 60;
460
461 return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
462 }
463
464 private async runAllSigns(source: string, fallbackPeer?: any, statusMsg?: Api.Message): Promise<void> {
465 const client = await getGlobalClient();
466 if (!client) return;
467 const conf = this.cfg.get();
468 const enabled = conf.targets.filter((t) => t.enabled);
469 if (!enabled.length) {
470 if (statusMsg) await this.edit(statusMsg, "❌ 没有启用的签到目标");
471 return;
472 }

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