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

Method showResult

encode/encode.ts:175–191  ·  view source on GitHub ↗
(
    msg: Api.Message, 
    originalText: string, 
    result: string, 
    typeName: string, 
    operation: string, 
    icon: string
  )

Source from the content-addressed store, hash-verified

173 typeName: string,
174 operation: string,
175 icon: string
176 ): Promise<void> {
177 const operationText = operation === "encode" ? "编码" : "解码";
178 const originalPreview = originalText.length > 200 ? originalText.substring(0, 200) + "..." : originalText;
179 const resultPreview = result.length > 3000 ? result.substring(0, 3000) + "..." : result;
180
181 await msg.edit({
182 text: `${icon} <b>${typeName} ${operationText}完成</b>\n\n<b>原文:</b>\n<code>${htmlEscape(originalPreview)}</code>\n\n<b>结果:</b>\n<code>${htmlEscape(resultPreview)}</code>\n\n${result.length > 3000 ? `⚠️ 结果过长,已截取前3000字符显示` : ""}`,
183 parseMode: "html"
184 });
185 }
186}
187
188export default new EncodePlugin();

Callers 1

processEncodingMethod · 0.95

Calls 2

htmlEscapeFunction · 0.70
editMethod · 0.45

Tested by

no test coverage detected