mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 03:59:17 +00:00
restore flow working!
This commit is contained in:
19
packages/bot/io/methods/toCtx.js
Normal file
19
packages/bot/io/methods/toCtx.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { generateRef, generateRefSerialize } = require('../../utils/hash')
|
||||
/**
|
||||
* @deprecate
|
||||
* @param answer string
|
||||
* @param options {media:string, buttons:[], capture:true default false}
|
||||
* @returns
|
||||
*/
|
||||
const toCtx = ({ body, from, prevRef, index }) => {
|
||||
return {
|
||||
ref: generateRef(),
|
||||
keyword: prevRef,
|
||||
answer: body,
|
||||
options: {},
|
||||
from,
|
||||
refSerialize: generateRefSerialize({ index, answer: body }),
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { toCtx }
|
||||
Reference in New Issue
Block a user