mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 12:09:15 +00:00
fix(provider): ⚡ fix send image baileys
This commit is contained in:
@@ -137,7 +137,7 @@ class BaileysProvider extends ProviderClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const btnCtx =
|
const btnCtx =
|
||||||
payload?.message?.templateButtonReplyMessage
|
payload?.message?.buttonsResponseMessage
|
||||||
?.selectedDisplayText
|
?.selectedDisplayText
|
||||||
|
|
||||||
if (btnCtx) payload.body = btnCtx
|
if (btnCtx) payload.body = btnCtx
|
||||||
@@ -229,23 +229,22 @@ class BaileysProvider extends ProviderClass {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
sendButtons = async (number, text, buttons) => {
|
sendButtons = async (number, text, buttons) => {
|
||||||
const numberClean = number.replace('+', '')
|
const numberClean = baileyCleanNumber(number)
|
||||||
|
|
||||||
const templateButtons = buttons.map((btn, i) => ({
|
const templateButtons = buttons.map((btn, i) => ({
|
||||||
index: `${i}`,
|
buttonId: `id-btn-${i}`,
|
||||||
quickReplyButton: {
|
buttonText: { displayText: btn.body },
|
||||||
displayText: btn.body,
|
type: 1,
|
||||||
id: `id-btn-${i}`,
|
|
||||||
},
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
const buttonMessage = {
|
||||||
console.log(templateButtons)
|
|
||||||
|
|
||||||
return this.vendor.sendMessage(`${numberClean}@c.us`, {
|
|
||||||
text,
|
text,
|
||||||
footer: '',
|
footer: '',
|
||||||
templateButtons: templateButtons,
|
buttons: templateButtons,
|
||||||
})
|
headerType: 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.vendor.sendMessage(numberClean, buttonMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user