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

Method sendNew

ai/ai.ts:1185–1202  ·  view source on GitHub ↗
(
    msg: Api.Message,
    text: string,
    options?: MessageOptions,
    replyToId?: number,
  )

Source from the content-addressed store, hash-verified

1183
1184 static async sendNew(
1185 msg: Api.Message,
1186 text: string,
1187 options?: MessageOptions,
1188 replyToId?: number,
1189 ): Promise<Api.Message> {
1190 if (!msg.client) {
1191 throw new Error("客户端未初始化");
1192 }
1193
1194 const topicRootId = getTopicRootId(msg);
1195 const replyTo = replyToId ?? topicRootId;
1196 return await msg.client.sendMessage(msg.chatId || msg.peerId, {
1197 message: text,
1198 ...(options || {}),
1199 ...(replyTo ? { replyTo } : {}),
1200 });
1201 }
1202}
1203
1204class MessageUtils {
1205 private configManagerPromise: Promise<ConfigManager>;

Callers 3

sendHtmlMethod · 0.45
executeMethod · 0.45

Calls 1

getTopicRootIdFunction · 0.70

Tested by

no test coverage detected