mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
[MD] Added template support and footers for buttons & templates (#942)
* Added template support and footers for buttons & templates * Template message readme
This commit is contained in:
31
README.md
31
README.md
@@ -265,6 +265,21 @@ const buttonMessage = {
|
||||
}
|
||||
|
||||
const sendMsg = await sock.sendMessage(id, buttonMessage)
|
||||
|
||||
//send a template message!
|
||||
const templateButtons = [
|
||||
{index: 1, urlButton: {displayText: '⭐ Star Baileys on GitHub!', url: 'https://github.com/adiwajshing/Baileys'}},
|
||||
{index: 2, callButton: {displayText: 'Call me!', phoneNumber: '+1 (234) 5678-901'}},
|
||||
{index: 3, quickReplyButton: {displayText: 'This is a reply, just like normal buttons!', id: 'id-like-buttons-message'}},
|
||||
]
|
||||
|
||||
const buttonMessage = {
|
||||
text: "Hi it's a template message",
|
||||
footer: 'Hello World',
|
||||
templateButtons: templateButttons
|
||||
}
|
||||
|
||||
const sendMsg = await sock.sendMessage(id, templateMessage)
|
||||
```
|
||||
|
||||
### Media Messages
|
||||
@@ -325,6 +340,22 @@ const buttonMessage = {
|
||||
}
|
||||
|
||||
const sendMsg = await sock.sendMessage(id, buttonMessage)
|
||||
|
||||
//send a template message with an image **attached**!
|
||||
const templateButtons = [
|
||||
{index: 1, urlButton: {displayText: '⭐ Star Baileys on GitHub!', url: 'https://github.com/adiwajshing/Baileys'}},
|
||||
{index: 2, callButton: {displayText: 'Call me!', phoneNumber: '+1 (234) 5678-901'}},
|
||||
{index: 3, quickReplyButton: {displayText: 'This is a reply, just like normal buttons!', id: 'id-like-buttons-message'}},
|
||||
]
|
||||
|
||||
const buttonMessage = {
|
||||
text: "Hi it's a template message",
|
||||
footer: 'Hello World',
|
||||
templateButtons: templateButttons,
|
||||
image: {url: 'https://example.com/image.jpeg'}
|
||||
}
|
||||
|
||||
const sendMsg = await sock.sendMessage(id, templateMessage)
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
Reference in New Issue
Block a user