Quoted messages

Quoted Messages feature lets users reference previous messages within a conversation. By quoting a message, users can provide additional context or relevant details, ensuring coherence even when referencing older messages.

You can quote a different message when publishing your own message using the SendText() method.

Method signature

Head over to the SendText() method for details.

Basic usage

Quote a message with the 16200000000000001 timetoken.

if(!chat.TryGetMessage("16200000000000001", out var quotedMessage))
{
return;
}
testChannel.SendText("message with a quote", new SendTextParams()
{
QuotedMessage = quotedMessage
});

Get quoted message

TryGetQuotedMessage() is a method that lists the original quoted message.

Method signature

This method has the following signature:

message.TryGetQuotedMessage(out Message quotedMessage)

Input

This method doesn't take any parameters.

Output

ParameterTypeDescription
quotedMessageout MessageThe quotedMessage to populate with the appropriate Message object if the method returns true. If it returns false, the quotedMessage remains uninitialized.

Basic usage

Return a quote from the message with the 16200000000000001 timetoken.

var channelId = "support";
var messageTimeToken = "16200000000000001";

// retrieve the channel details
if (chat.TryGetChannel(channelId, out var channel))
{
Console.WriteLine($"Found channel with name {channel.Name}");

// retrieve the specific message by its timetoken
if (channel.TryGetMessage(messageTimeToken, out var message))
{
// try to get the quoted message
if (message.TryGetQuotedMessage(out var quotedMessage))
{
Console.WriteLine($"Quoted message: {quotedMessage.MessageText}");
show all 30 lines
Last updated on