(
msg: Api.Message,
text: string,
options?: MessageOptions,
replyToId?: number,
)
| 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 | |
| 1204 | class MessageUtils { |
| 1205 | private configManagerPromise: Promise<ConfigManager>; |
no test coverage detected