Message type - Media embed
Enables sending a image URLs or media URLs as a message. You can send GIFs, Tweets, Youtube links, etc. Simply pass in the URL of the media as content.
- js
// userAlice.chat.send(recipient, message)
// This section focuses on customization parameters for 'message' object
const aliceMessagesBob = await userAlice.chat.send(recipient, {
type: 'MediaEmbed',
content:
'https://media1.giphy.com/media/FtlUfrq3pVZXVNjoxf/giphy360p.mp4?cid=ecf05e47jk317254v9hbdjrknemduocie4pf54wtsir98xsx&ep=v1_videos_search&rid=giphy360p.mp4&ct=v',
});
Customization parameters
When sending a message, you can customize the following params
Param | Type | Subtype | Default | Remarks |
---|---|---|---|---|
recipient | string | - | - | Recipient supports a number of address format 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 | MediaEmbed | Text | Type of message Content |
- | message.content | string | - | Message Content |
Note: Parameters
in this style
are mandatory.