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

Function getDisplayName

pmcaptcha/pmcaptcha.ts:389–397  ·  view source on GitHub ↗
(client: TelegramClient, userId: number)

Source from the content-addressed store, hash-verified

387 if (nameCache.has(userId)) return nameCache.get(userId)!;
388 const user = await fetchUserInfo(client, userId);
389 if (user) {
390 const name = [user.firstName, user.lastName].filter(Boolean).join(" ").trim() || "Unknown";
391 return name;
392 }
393 return String(userId);
394}
395
396function userLink(id: number, name: string): string {
397 return `<a href="tg://user?id=${attrEscape(id)}">${htmlEscape(name)} (${htmlEscape(id)})</a>`;
398}
399
400function isBotFromSender(sender: any): boolean {

Callers 5

sendCaptchaFunction · 0.70
handleReplyFunction · 0.70
executeBlockActionsFunction · 0.70
messageListenerFunction · 0.70
pmcaptchaFunction · 0.70

Calls 2

fetchUserInfoFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected