feat: link previews on MD

This commit is contained in:
Adhiraj Singh
2022-04-19 19:00:32 +05:30
parent a08cd00107
commit 872536fa5b
6 changed files with 246 additions and 6 deletions

View File

@@ -413,6 +413,17 @@ const reactionMessage = {
const sendMsg = await sock.sendMessage(id, reactionMessage)
```
### Sending messages with link previews
1. By default, WA MD does not seem to have link generation when sent from the web
2. Baileys has an extra function to help generate the content for these link previews
3. To enable this function's usage, add `link-preview-js` as a dependency to your project with `yarn add link-preview-js`
4. Send a link:
``` ts
// send a link
const sentMsg = await sock.sendMessage(id, { text: 'Hi, this was sent using https://github.com/adiwajshing/baileys' })
```
### Media Messages
Sending media (video, stickers, images) is easier & more efficient than ever.