SDKsHarmonyOSEnterprise
Create quote message
Quote an existing message with a simple text reply.
Creates a quote message referencing a previous message with text reply content.
Code example
import sdk, { CreateQuoteMessageReq, CreateQuoteMessageResp } from '@openimsdk/imsdk';
const request: CreateQuoteMessageReq = {
text: 'Received, I will handle it today.',
quoteMessage: originalMessage,
};
const response: CreateQuoteMessageResp = await sdk.createQuoteMessage(request);
const message = response.message;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Reply body text. |
quoteMessage | IMMessage | Yes | The original message being quoted. |
Return value
Returns a Promise resolving to CreateQuoteMessageResp:
| Property | Type | Description |
|---|---|---|
message | IMMessage | Locally instantiated quote message object. |
State changes after the call
originalMessage should come directly from query results or message events; do not fabricate incomplete mock objects. Verify that the referenced message belongs to the active conversation, and design a fallback UI in case the original message has been deleted or cannot be loaded. Resolving the Promise constructs the message object locally; call Send message to dispatch it.
Was this page helpful?