Skip to content

Replies

With XMTP, replies are represented as objects with the following keys:

Reply object

The reply type contains the following

{
  reference: someMessageID, //ID of the message being replied to
  contentType: ContentType, // type of the reply
  content: "I concur", //String representation of the reply
};

Receive a reply

Now that you understand how replies are represented, you can receive them in your app. Here's an example of how you can receive a reply in your app:

const { content, typeId, getMessageById } = context;
 
if (typeId === "reply") {
  //Get the message that was replied to
  const msg = await getMessageById(content.reference);
  // Use reply...
  const { content: reply } = content;
}