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

Function buildEntityDisplay

biko/biko.ts:129–139  ·  view source on GitHub ↗
(entity: any, fallbackRaw: string)

Source from the content-addressed store, hash-verified

127 if (entity?.username) parts.push(`@${entity.username}`);
128 if (entity?.id !== undefined && entity?.id !== null) {
129 parts.push(String(entity.id));
130 }
131 return parts.join(" ").trim() || fallbackRaw;
132}
133
134async function resolveEntityWithFallback(
135 client: any,
136 raw: string,
137): Promise<any> {
138 const attempts: any[] = [raw];
139 if (/^-?\d+$/.test(raw)) {
140 const numeric = Number(raw);
141 if (Number.isSafeInteger(numeric)) attempts.push(numeric);
142 }

Callers 2

resolveChatTargetFunction · 0.85
resolveSourceUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected