Files
simplex-chat/packages/simplex-chat-nodejs/docs/api.Class.LiveMessage.md
EvgenyandEvgeny @ SimpleX Chat 46b2cf9f85 nodejs: add tests to library (#7694)
* nodejs: add tests to library

* new tests

* remove message splitting

* fix race

* docs

* replace extract-zip with yauzl that it wraps (high severity issue)

* fix ci tests

* skip server tests on macos and win unless SMP_SERVER is set

* fix win test

* fix win test

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-19 19:49:44 +01:00

1.7 KiB

simplex-chat


simplex-chat / api / LiveMessage

Class: LiveMessage

Defined in: src/api.ts:1005

Text shown as a live message while it is written, e.g. a streamed reply.

Constructors

Constructor

new LiveMessage(chat, chatType, chatId, interval?, onError?): LiveMessage

Defined in: src/api.ts:1019

Parameters

chat

Pick<ChatApi, "apiSendMessages" | "apiUpdateChatItem" | "apiDeleteChatItems">

Chat API, or an object with its methods to send, update and delete messages.

chatType

ChatType

Chat type.

chatId

number

Contact or group ID.

interval?

number = 3000

Minimum interval between updates of the live message, in milliseconds.

onError?

(error) => void

Error handler for sending, updating and deleting messages. Errors are logged when it is omitted.

Returns

LiveMessage

Methods

end()

end(text?): Promise<void>

Defined in: src/api.ts:1049

Finalize the live message with the text, or with the last text when omitted. A message without text is deleted. The next update starts a new live message. The returned promise resolves after all queued commands complete.

Parameters

text?

string = ...

Returns

Promise<void>


update()

update(text): void

Defined in: src/api.ts:1031

Set the text of the live message. The first text is sent at once; later texts update the message at most once per interval.

Parameters

text

string

Returns

void