Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs for reaction message type #848

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions docs/chat/02-message-types/05-Message-Type-Reaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ hide_title: true
slug: ./reaction
displayed_sidebar: pushChatSidebar
sidebar_position: 5
image: "/assets/docs/previews/docs_chat_message_type--reaction.png"
image: '/assets/docs/previews/docs_chat_message_type--reaction.png'
---

# Message type - Reaction
Expand All @@ -27,9 +27,9 @@ import TabItem from '@theme/TabItem';
// This section focuses on customization parameters for 'message' object
const aliceMessagesBob = await userAlice.chat.send(recipient, {
type: 'Reaction',
content: '👍', // content can be eliminated
action: 'ThumbsUp', // can be "ThumbsUp", "ThumbsDown", "Heart", "Clap", "Laugh", "Sad", etc
reference: 'bafyreia2okco5ocdxmoxon72erviypaht74u3dqunf3vydu237ybju4kw4', // pass in the reference to the message hash that this reaction is intended for
content: '👍', // reaction
reference:
'v2:7a470f25759fab8b042867dca9297a24327ba67986a414bf8b3bf17536ff5016', // pass in the reference to the message hash that this reaction is intended for, hash of the message can be found in the message object as cid property
});
```

Expand All @@ -42,13 +42,12 @@ const aliceMessagesBob = await userAlice.chat.send(recipient, {

When sending a message, you can customize the following params

| Param | Type | Subtype | Default | Remarks |
| ------------- | --------------------- | ------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _`recipient`_ | `string` | - | - | [Recipient supports a number of address format](/docs/chat/supported-wallet-standards/ 'Supported wallet standards for Push Chat') including wallet address, chain agnostic wallet address, NFT addresses or even chatid which is useful in groups |
| _`message`_ | `object` | - | - | Configuration for message to be sent |
| - | _`message.type`_ | `Meta` | `Text` | Type of message Content |
| - | _`message.content`_ | `string` | - | Emoji Symbol - 👍, 👎, ❤️, 👏, 😄, 😢 |
| - | _`options.action`_ | `string`, choose from `ThumbsUp`, `ThumbsDown`, `Heart`, `Clap`, `Laugh`, `Sad` | - | Action that is getting applied in the Meta message action |
| - | _`options.reference`_ | `{ affected : string[]: arbitrary?: { [key: string]: any } }` | - | Pass in the reference to the message hash that this reaction is intended for |
| Param | Type | Subtype | Default | Remarks |
| ------------- | --------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| _`recipient`_ | `string` | - | - | [Recipient supports a number of address format](/docs/chat/supported-wallet-standards/ 'Supported wallet standards for Push Chat') including wallet address, chain agnostic wallet address, NFT addresses or even chatid which is useful in groups |
| _`message`_ | `object` | - | - | Configuration for message to be sent |
| - | _`message.type`_ | `Meta` | `Text` | Type of message Content |
| - | _`message.content`_ | `string` | - | Emoji Symbol - 👍, 👎, ❤️, 👏, 😄, 😢 |
| - | _`options.reference`_ | `string` | - | Pass in the reference to the message hash that this reaction is intended for , hash of the message can be found in the message object as cid property |

> Note: Parameters _`in this style`_ are mandatory.