feat(bot): flowDynamic buttons, media

This commit is contained in:
Leifer Mendez
2023-01-23 11:52:49 +01:00
parent 79cc31a96f
commit 3c4b1c0fc4
2 changed files with 12 additions and 5 deletions

View File

@@ -5,12 +5,12 @@ const { generateRef, generateRefSerialize } = require('../../utils/hash')
* @param options {media:string, buttons:[], capture:true default false}
* @returns
*/
const toCtx = ({ body, from, prevRef, index }) => {
const toCtx = ({ body, from, prevRef, options = {}, index }) => {
return {
ref: generateRef(),
keyword: prevRef,
answer: body,
options: {},
options: options ?? {},
from,
refSerialize: generateRefSerialize({ index, answer: body }),
}