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

Method getHourSticker

lu_bs/lu_bs.ts:103–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 await this.loadStickerSet();
102 }
103
104 if (!this.stickerSet || !this.stickerSet.documents || this.stickerSet.documents.length === 0) {
105 return null;
106 }
107
108 const now = new Date();
109 let hour = now.getHours() - 1;
110
111 if (now.getMinutes() > 30) {
112 hour += 1;
113 }
114
115 hour = hour % 12;
116 if (hour === -1) {
117 hour = 11;
118 }
119
120 // 确保索引在有效范围内
121 const stickerIndex = hour % this.stickerSet.documents.length;
122 return this.stickerSet.documents[stickerIndex];
123 }
124
125 // 发送整点贴纸
126 private async sendHourlyStickers(client: any) {
127 if (!this.db) await this.initDB();
128
129 const sticker = await this.getHourSticker();
130 if (!sticker) {

Callers 1

sendHourlyStickersMethod · 0.95

Calls 1

loadStickerSetMethod · 0.95

Tested by

no test coverage detected