refactor: remove list and button
This commit is contained in:
parent
8263ffb942
commit
33a2f0c121
3 changed files with 16 additions and 40 deletions
|
|
@ -1,4 +1,4 @@
|
|||
const { MessageMedia, Location, Buttons, List, Poll } = require('whatsapp-web.js')
|
||||
const { MessageMedia, Location, Poll } = require('whatsapp-web.js')
|
||||
const { sessions } = require('../sessions')
|
||||
const { sendErrorResponse } = require('../utils')
|
||||
|
||||
|
|
@ -418,7 +418,7 @@ const reply = async (req, res) => {
|
|||
},
|
||||
contentType: {
|
||||
type: 'string',
|
||||
description: 'The type of message content, must be one of the following: string, MessageMedia, MessageMediaFromURL, Location, Contact, Poll, Buttons, or List',
|
||||
description: 'The type of message content, must be one of the following: string, MessageMedia, MessageMediaFromURL, Location, Contact or Poll',
|
||||
},
|
||||
content: {
|
||||
type: 'object',
|
||||
|
|
@ -465,14 +465,6 @@ const reply = async (req, res) => {
|
|||
contentMessage = new Location(content.latitude, content.longitude, content.description)
|
||||
break
|
||||
}
|
||||
case 'Buttons': {
|
||||
contentMessage = new Buttons(content.body, content.buttons, content.title, content.footer)
|
||||
break
|
||||
}
|
||||
case 'List': {
|
||||
contentMessage = new List(content.body, content.buttonText, content.sections, content.title, content.footer)
|
||||
break
|
||||
}
|
||||
case 'Contact': {
|
||||
const contactId = content.contactId.endsWith('@c.us') ? content.contactId : `${content.contactId}@c.us`
|
||||
contentMessage = await client.getContactById(contactId)
|
||||
|
|
|
|||
Loading…
Reference in a new issue