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

Method getTextFromArgsOrReply

encode/encode.ts:145–172  ·  view source on GitHub ↗
(msg: Api.Message, args: string[], operation: string)

Source from the content-addressed store, hash-verified

143 if (!text.trim()) {
144 try {
145 const reply = await safeGetReplyMessage(msg);
146 if (reply && reply.text) {
147 text = reply.text.trim();
148 } else {
149 await msg.edit({
150 text: `❌ <b>缺少文本内容</b>\n\n💡 请提供要${operation === "encode" ? "编码" : "解码"}的文本或回复一条消息`,
151 parseMode: "html"
152 });
153 return null;
154 }
155 } catch (replyError: any) {
156 console.error("获取回复消息失败:", replyError);
157 await msg.edit({
158 text: `❌ <b>缺少文本内容</b>\n\n💡 请提供要${operation === "encode" ? "编码" : "解码"}的文本`,
159 parseMode: "html"
160 });
161 return null;
162 }
163 }
164
165 return text;
166 }
167
168 // 显示处理结果
169 private async showResult(
170 msg: Api.Message,
171 originalText: string,
172 result: string,
173 typeName: string,
174 operation: string,
175 icon: string

Callers 1

processEncodingMethod · 0.95

Calls 2

errorMethod · 0.80
editMethod · 0.45

Tested by

no test coverage detected