diff --git a/__test__/07-case.test.js b/__test__/07-case.test.js index 024fc60..6eb8e42 100644 --- a/__test__/07-case.test.js +++ b/__test__/07-case.test.js @@ -82,8 +82,7 @@ test(`[Caso - 07] Retornar estado`, async () => { assert.is('Tu datos son:', getHistory[6]) assert.is('Nombre: Leifer Edad: 90', getHistory[7]) assert.is('🤖🤖 Gracias por tu participacion', getHistory[8]) - assert.is('🤖🤖 Gracias por tu participacion', getHistory[9]) - assert.is(undefined, getHistory[10]) + assert.is(undefined, getHistory[9]) }) test.run() diff --git a/packages/bot/core/core.class.js b/packages/bot/core/core.class.js index 1c15932..1258b5a 100644 --- a/packages/bot/core/core.class.js +++ b/packages/bot/core/core.class.js @@ -172,10 +172,11 @@ class CoreClass { for (const msg of parseListMsg) { await this.sendProviderAndSave(from, msg) } - const nextFlow = await this.flowClass.find(refToContinue?.ref, true) const filterNextFlow = nextFlow.filter((msg) => msg.refSerialize !== currentPrev?.refSerialize) - console.log(`🚩🚩🚩`, filterNextFlow?.answer) + + if (filterNextFlow.map((i) => i.keyword).includes(currentPrev?.ref)) return + return sendFlow(filterNextFlow, from, { prev: undefined }) }