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

Function splitLongMessage

subinfo/subinfo.ts:241–255  ·  view source on GitHub ↗
(text: string, maxLength = 4000)

Source from the content-addressed store, hash-verified

239 regions: Object.fromEntries(Object.entries(regions).filter(([, v]) => v > 0)),
240 names,
241 };
242 } catch { /* 忽略 Base64 解析错误 */ }
243 return null;
244 } catch { return null; }
245}
246
247// 判断订阅周期类型 (单次/月付/长期)
248function getSubType(expireTs: number): { isLongTerm: boolean; isSingle: boolean; resetInfo: string; daysToReset: number } {
249 const now = Math.floor(Date.now() / 1000);
250 if (expireTs === 0) return { isLongTerm: false, isSingle: true, resetInfo: "未知或永久", daysToReset: 0 };
251
252 const expireTime = new Date(expireTs * 1000);
253 const daysToExpire = Math.max(0, Math.floor((expireTs - now) / 86400));
254 const isLongTerm = (expireTs - now) > 3 * 365 * 86400; // 超过三年视为长期
255
256 if (daysToExpire < 45 && !isLongTerm) {
257 return { isSingle: true, isLongTerm: false, resetInfo: "单次订阅,无重置", daysToReset: daysToExpire };
258 }

Callers 2

handleSubinfoMethod · 0.85
handleChaMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected