(
target: TargetChat,
stats: AdminStat[],
counts: { totalCount: number; botCount: number; nonBotCount: number },
)
| 923 | "", |
| 924 | ]; |
| 925 | |
| 926 | const bodyLines: string[] = []; |
| 927 | |
| 928 | for (let index = 0; index < stats.length; index++) { |
| 929 | const stat = stats[index]; |
| 930 | bodyLines.push(buildCompactSortLine(stat, index, stats.length)); |
| 931 | } |
| 932 | |
| 933 | return [...headerLines, ...bodyLines].join("\n").trim(); |
| 934 | } |
| 935 | |
| 936 | function buildTailText( |
| 937 | target: TargetChat, |
| 938 | stats: AdminStat[], |
| 939 | counts: { totalCount: number; botCount: number; nonBotCount: number }, |
| 940 | limit: number, |
| 941 | ): string { |
| 942 | const unlockedStats = stats.filter((stat) => !stat.lockedSeat); |
| 943 | const visibleStats = unlockedStats.slice(-limit).reverse(); |
| 944 | |
| 945 | const headerLines = [ |
| 946 | `📉 <b>未锁席位倒数榜</b>`, |
| 947 | buildTargetDisplay(target), |
| 948 | `管理员数量: 总 <code>${counts.totalCount}</code> | Bot <code>${counts.botCount}</code> | 非 Bot <code>${counts.nonBotCount}</code>`, |
| 949 | `未锁席位: <code>${unlockedStats.length}</code> | 展示: <code>${visibleStats.length}</code> | 倒数范围: <code>${limit}</code>`, |
no test coverage detected