* 更新消息
(messageId: string, text: string)
| 310 | * 更新消息 |
| 311 | */ |
| 312 | async updateMessage(messageId: string, text: string): Promise<void> { |
| 313 | const content = JSON.stringify({ text }); |
| 314 | |
| 315 | const response = await this.client.im.message.update({ |
| 316 | path: { message_id: messageId }, |
| 317 | data: { |
| 318 | msg_type: 'text', |
| 319 | content, |
| 320 | }, |
| 321 | }); |
| 322 | |
| 323 | if (response.code !== 0) { |
| 324 | throw new Error(`Feishu message update failed: ${response.msg || `code ${response.code}`}`); |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | /** |
| 329 | * 更新消息为富文本格式 |
no outgoing calls
no test coverage detected