mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Merge pull request #562 from WhiskeySockets/SheIITear-patch-2
This commit is contained in:
92
README.md
92
README.md
@@ -376,65 +376,6 @@ const sentMsg = await sock.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",
|
|
||||||
footer: 'Hello World',
|
|
||||||
buttons: buttons,
|
|
||||||
headerType: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
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 templateMessage = {
|
|
||||||
text: "Hi it's a template message",
|
|
||||||
footer: 'Hello World',
|
|
||||||
templateButtons: templateButtons
|
|
||||||
}
|
|
||||||
|
|
||||||
const sendMsg = await sock.sendMessage(id, templateMessage)
|
|
||||||
|
|
||||||
// send a list message!
|
|
||||||
const sections = [
|
|
||||||
{
|
|
||||||
title: "Section 1",
|
|
||||||
rows: [
|
|
||||||
{title: "Option 1", rowId: "option1"},
|
|
||||||
{title: "Option 2", rowId: "option2", description: "This is a description"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Section 2",
|
|
||||||
rows: [
|
|
||||||
{title: "Option 3", rowId: "option3"},
|
|
||||||
{title: "Option 4", rowId: "option4", description: "This is a description V2"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const listMessage = {
|
|
||||||
text: "This is a list",
|
|
||||||
footer: "nice footer, link: https://google.com",
|
|
||||||
title: "Amazing boldfaced list title",
|
|
||||||
buttonText: "Required, text on the button to view the list",
|
|
||||||
sections
|
|
||||||
}
|
|
||||||
|
|
||||||
const sendMsg = await sock.sendMessage(id, listMessage)
|
|
||||||
|
|
||||||
const reactionMessage = {
|
const reactionMessage = {
|
||||||
react: {
|
react: {
|
||||||
text: "💖", // use an empty string to remove the reaction
|
text: "💖", // use an empty string to remove the reaction
|
||||||
@@ -489,39 +430,6 @@ await sock.sendMessage(
|
|||||||
{ audio: { url: "./Media/audio.mp3" }, mimetype: 'audio/mp4' }
|
{ audio: { url: "./Media/audio.mp3" }, mimetype: 'audio/mp4' }
|
||||||
{ url: "Media/audio.mp3" }, // can send mp3, mp4, & ogg
|
{ 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: 'https://example.com/image.jpeg'},
|
|
||||||
caption: "Hi it's button message",
|
|
||||||
footer: 'Hello World',
|
|
||||||
buttons: buttons,
|
|
||||||
headerType: 4
|
|
||||||
}
|
|
||||||
|
|
||||||
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: templateButtons,
|
|
||||||
image: {url: 'https://example.com/image.jpeg'}
|
|
||||||
}
|
|
||||||
|
|
||||||
const sendMsg = await sock.sendMessage(id, templateMessage)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|||||||
Reference in New Issue
Block a user