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

Method checkTime

sendat/sendat.ts:86–101  ·  view source on GitHub ↗
(time: string, minValue?: number, maxValue?: number)

Source from the content-addressed store, hash-verified

84 if (isNaN(timeNum)) {
85 throw new Error(`时间值 ${time} 不是有效数字`);
86 }
87 if (maxValue !== undefined && timeNum > maxValue) {
88 throw new Error(`时间值 ${time} 过大`);
89 }
90 if (minValue !== undefined && timeNum < minValue) {
91 throw new Error(`时间值 ${time} 过小`);
92 }
93 if (timeNum < 0) {
94 throw new Error(`时间值 ${time} 不能为负数`);
95 }
96 return time;
97 }
98
99 // 解析任务字符串
100 parseTask(text: string): void {
101 const parts = text.split("|");
102 if (parts.length < 2) {
103 throw new Error("任务格式错误,请使用 '时间 | 消息内容' 格式");
104 }

Callers 1

parseTaskMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected