mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Update README.md (#816)
This commit is contained in:
33
README.md
33
README.md
@@ -274,6 +274,22 @@ const sentMsg = await conn.sendMessage(
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// send a buttons message!
|
||||
const buttons = [
|
||||
{buttonId: 'id1', buttonText: {displayText: 'Button 1'}, type: 1},
|
||||
{buttonId: 'id2', buttonText: {displayText: 'Button 2'}, type: 1},
|
||||
{buttonId: 'id3', buttonText: {displayText: 'Button 3'}, type: 1}
|
||||
]
|
||||
|
||||
const buttonMessage = {
|
||||
text: "Hi it's button message",
|
||||
footerText: 'Hello World',
|
||||
buttons: buttons,
|
||||
headerType: 1
|
||||
}
|
||||
|
||||
const sendMsg = await conn.sendMessage(id, buttonMessage)
|
||||
```
|
||||
|
||||
### Media Messages
|
||||
@@ -317,6 +333,23 @@ await conn.sendMessage(
|
||||
{ audio: { url: "./Media/audio.mp3" }, mimetype: 'audio/mp4' }
|
||||
{ url: "Media/audio.mp3" }, // can send mp3, mp4, & ogg
|
||||
)
|
||||
|
||||
// send a buttons message with image header!
|
||||
const buttons = [
|
||||
{buttonId: 'id1', buttonText: {displayText: 'Button 1'}, type: 1},
|
||||
{buttonId: 'id2', buttonText: {displayText: 'Button 2'}, type: 1},
|
||||
{buttonId: 'id3', buttonText: {displayText: 'Button 3'}, type: 1}
|
||||
]
|
||||
|
||||
const buttonMessage = {
|
||||
image: {url: url},
|
||||
caption: "Hi it's button message",
|
||||
footerText: 'Hello World',
|
||||
buttons: buttons,
|
||||
headerType: 4
|
||||
}
|
||||
|
||||
const sendMsg = await conn.sendMessage(id, buttonMessage)
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
Reference in New Issue
Block a user