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.

Quote message

There is no dedicated method for quoting messages. You must use SendText() - the same method you use for sending text messages - and attach the required quoted message information.

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;
}
await 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

ParameterDescription
quotedMessage
Type: out Message
The 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