MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / formatTimeLeft

Function formatTimeLeft

plugins/schedule.js:77–92  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

75 return null;
76}
77function formatTimeLeft(ms) {
78 if (ms <= 0)
79 return 'now';
80 const totalSec = Math.floor(ms / 1000);
81 const h = Math.floor(totalSec / 3600);
82 const m = Math.floor((totalSec % 3600) / 60);
83 const s = totalSec % 60;
84 const parts = [];
85 if (h)
86 parts.push(`${h}h`);
87 if (m)
88 parts.push(`${m}m`);
89 if (s || parts.length === 0)
90 parts.push(`${s}s`);
91 return parts.join(' ');
92}
93// ── Scheduler Engine ───────────────────────────────────────────────────────
94// Started once when bot connects — checks every 10s for due messages
95let _engineStarted = false;

Callers 2

handlerFunction · 0.90
handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected