(msg: Api.Message, text: string, entities: Api.TypeMessageEntity[], seconds: number = 5)
| 613 | /** |
| 614 | * Helper method to get display text for reactions (fallback without entities) |
| 615 | */ |
| 616 | private async getReactionDisplay(msg: Api.Message, emojiText: string, reactions: (string | BigInteger)[]): Promise<string> { |
| 617 | const displayParts: string[] = []; |
| 618 | let customEmojiCount = 0; |
| 619 | |
| 620 | for (const reaction of reactions) { |
| 621 | if (typeof reaction === 'string') { |
| 622 | // Standard emoji - can be displayed directly |
| 623 | displayParts.push(reaction); |
| 624 | } else { |
| 625 | // Custom emoji - use a special indicator |
| 626 | customEmojiCount++; |
| 627 | // Show custom emoji with its ID prefix for identification |
| 628 | const idPrefix = reaction.toString().slice(0, 4); |
| 629 | displayParts.push(`[Premium:${idPrefix}]`); |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | // If there are custom emojis, add a note |
| 634 | if (customEmojiCount > 0) { |
| 635 | return displayParts.join(' ') + ` (含 ${customEmojiCount} 个会员表情)`; |
| 636 | } |
| 637 | |
| 638 | return displayParts.join(' '); |
| 639 | } |
| 640 | |
| 641 | private async editAndDelete(msg: Api.Message, text: string, seconds: number = 5) { |
| 642 | await msg.edit({ text, parseMode: "html" }); |
| 643 | if (!this.db.data.config.keepLog) { |
| 644 | this.scheduleDelete(msg, seconds); |
| 645 | } |
| 646 | } |
| 647 |
no test coverage detected