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

Function buildChatLink

sum/sum.ts:384–391  ·  view source on GitHub ↗
(chatId: string, username?: string)

Source from the content-addressed store, hash-verified

382function buildChatLink(chatId: string, username?: string): string {
383 if (username) {
384 return `https://t.me/${username}`;
385 }
386 // 私有群:chatId 格式为 -100xxxxx,需要去掉 -100 前缀
387 const numericId = chatId.replace(/^-100/, '');
388 return `https://t.me/c/${numericId}`;
389}
390
391// 构建消息链接
392function buildMessageLink(chatId: string, messageId: number, username?: string): string {
393 if (username) {
394 return `https://t.me/${username}/${messageId}`;

Callers 1

SummaryPluginClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected