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

Function buildSortText

admin_board/admin_board.ts:925–946  ·  view source on GitHub ↗
(
  target: TargetChat,
  stats: AdminStat[],
  counts: { totalCount: number; botCount: number; nonBotCount: number },
)

Source from the content-addressed store, hash-verified

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
936function 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>`,

Callers 1

AdminBoardPluginClass · 0.85

Calls 2

buildTargetDisplayFunction · 0.85
buildCompactSortLineFunction · 0.85

Tested by

no test coverage detected