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

Method traceKeyword

trace/trace.ts:344–363  ·  view source on GitHub ↗
(msg: Api.Message, keyword: string, emojiText: string)

Source from the content-addressed store, hash-verified

342 msgBuilder.addLine(`├ 📊 表情数: ${reactionCount} 个 (含 ${customCount} 个会员表情)`);
343 msgBuilder.addLine(`└ 📊 当前追踪: ${Object.keys(this.db.data.users).length} 个用户`);
344
345 const { text: fullMessage, entities: messageEntities } = msgBuilder.build();
346 await this.editAndDeleteWithEntities(msg, fullMessage, messageEntities, 10);
347 } else {
348 // Use HTML formatting for messages without custom emojis
349 const htmlMsg = `✅ <b>追踪成功</b>\n` +
350 `├ 👤 用户: ${userEntity.display}\n` +
351 `├ 🎯 表情: ${reactions.join(' ')}\n` +
352 `├ 📊 表情数: ${reactionCount} 个\n` +
353 `└ 📊 当前追踪: ${Object.keys(this.db.data.users).length} 个用户`;
354 await this.editAndDelete(msg, htmlMsg, 10);
355 }
356 }
357
358 private async untraceUser(msg: Api.Message, repliedMsg: Api.Message) {
359 const userId = repliedMsg.senderId?.toString();
360 if (userId && this.db.data.users[userId]) {
361 const standardCount = this.db.data.users[userId].filter((r: string | BigInteger) => typeof r === 'string').length;
362 const customCount = this.db.data.users[userId].filter((r: string | BigInteger) => typeof r !== 'string').length;
363 const previousReactions = `${standardCount}个标准 + ${customCount}个会员表情`;
364 delete this.db.data.users[userId];
365 await this.db.write();
366 const userEntity = await this.formatEntity(userId);

Callers 1

handleTraceMethod · 0.95

Calls 5

parseReactionsMethod · 0.95
editAndDeleteMethod · 0.95
getReactionDisplayMethod · 0.95
writeMethod · 0.80
htmlEscapeFunction · 0.70

Tested by

no test coverage detected