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

Method doSv

fbi/fbi.ts:315–333  ·  view source on GitHub ↗
(msg: Api.Message, args: string[])

Source from the content-addressed store, hash-verified

313 try {
314 const e = entityFields(await cl.getEntity(raw));
315 targetId = String(e.id);
316 const plain = htmlEsc([e.firstName, e.lastName].filter(Boolean).join(' ') || e.title || targetId);
317 name = e.username ? `<a href="https://t.me/${e.username}">${plain}</a>` : plain;
318 } catch {
319 name = raw;
320 targetId = raw.replace(/^@/, "");
321 }
322 } else if (msg.isReply) {
323 const r = await safeGetReplyMessage(msg);
324 if (r?.senderId) {
325 targetId = String(r.senderId);
326 try {
327 const u = entityFields(await cl.getEntity(r.senderId));
328 const plain = htmlEsc([u.firstName, u.lastName].filter(Boolean).join(' ') || targetId);
329 name = u.username ? `<a href="https://t.me/${u.username}">${plain}</a>` : plain;
330 } catch {
331 name = targetId;
332 }
333 }
334 }
335 return targetId ? { id: targetId, name } : null;
336 }

Callers 1

onCmdMethod · 0.95

Calls 4

resolveTargetMethod · 0.95
persistDbMethod · 0.95
editMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected