---
source_url: https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/quotes
title: Quoted messages
updated_at: 2026-06-17T11:37:27.990Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Quoted messages

Quote previous messages to provide context when responding to older messages in a conversation.

## Quote message

Use [SetQuotedMessage()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#set-quoted-message) on a [MessageDraft](https://www.pubnub.com/docs/chat/unreal-chat-sdk/learn/chat-entities/message-draft) to attach a quoted message, then call [Send()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#send-a-draft-message) to publish.

### Method signature

Refer to the [SetQuotedMessage()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#set-quoted-message) method for details.

### Sample code

:::tip Reference code
This example is a self-contained code snippet ready to be run. Set up your Unreal project and follow the instructions in the lines marked with `ACTION REQUIRED` before running the code. Use it as a reference when working with other examples in this document.
:::

Quote a message using a message draft.

###### Actor.h

```cpp
UFUNCTION(BlueprintCallable, Category = "PubnubChat|Samples|ChatMessageDraft")
void QuoteMessageSample();
```

###### Actor.cpp

```cpp
// ACTION REQUIRED: Replace ASample_ChatMessageDraft with name of your Actor class
void ASample_ChatMessageDraft::QuoteMessageSample()
{
	// snippet.hide
	UPubnubChatChannel* Channel = nullptr;
	UPubnubChatMessage* Message = nullptr;
	// snippet.show

	// Assumes Channel is a valid UPubnubChatChannel (e.g. from GetChannel)
	// Assumes Message is a valid UPubnubChatMessage to quote (e.g. from channel history)

	// Send a message that quotes another message
	UPubnubChatMessageDraft* MessageDraft = Channel->CreateMessageDraft();
	MessageDraft->SetQuotedMessage(Message);
	MessageDraft->InsertText(0, "Quoting this: ");
	MessageDraft->Send();
}
```

## Remove quoted message

To remove a quoted message from a draft, call [SetQuotedMessage()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#set-quoted-message) with `nullptr`.

### Method signature

Refer to the [SetQuotedMessage()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#set-quoted-message) method for details.

### Sample code

Remove the quoted message from a draft.

```cpp
MessageDraft->SetQuotedMessage(nullptr);
```

## Get quoted message

To check which message is currently quoted in a draft, call [GetQuotedMessage()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#get-quoted-message).

### Method signature

Refer to the [GetQuotedMessage()](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/drafts#get-quoted-message) method for details.