mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 20:19:15 +00:00
refactor(io): added new method addChild
This commit is contained in:
15
packages/bot/io/methods/addChild.js
Normal file
15
packages/bot/io/methods/addChild.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const { toSerialize } = require('./toSerialize')
|
||||
/**
|
||||
* @deprecate
|
||||
* @param answer string
|
||||
* @param options {media:string, buttons:[], capture:true default false}
|
||||
* @returns
|
||||
*/
|
||||
const addChild = (flowIn = null) => {
|
||||
if (!flowIn?.toJson) {
|
||||
throw new Error('DEBE SER UN FLOW CON toJSON()')
|
||||
}
|
||||
return toSerialize(flowIn.toJson())
|
||||
}
|
||||
|
||||
module.exports = { addChild }
|
||||
Reference in New Issue
Block a user