next save conversation

This commit is contained in:
Leifer Mendez
2022-11-15 20:47:12 +01:00
parent a5c38658a8
commit 1290d6b478
12 changed files with 71 additions and 50 deletions

View File

@@ -46,9 +46,8 @@ class CoreClass {
* @private
* @param {*} ctxMessage
*/
handleMsg = ({ body, to, from }) => {
handleMsg = ({ body, from }) => {
let msgToSend = []
console.log('____', this.databaseClass.listHistory)
const prevMsg = [...this.databaseClass.listHistory].pop()
if (prevMsg?.ref && prevMsg?.options?.capture) {

View File

@@ -23,6 +23,7 @@
"license": "ISC",
"devDependencies": {
"@bot-whatsapp/cli": "*",
"@bot-whatsapp/provider": "*",
"kleur": "^4.1.5"
}
}

View File

@@ -1,13 +1,14 @@
const { test } = require('uvu')
const assert = require('uvu/assert')
const MockProvider = require('../../../__mocks__/mock.provider')
const { createBot, CoreClass } = require('@bot-whatsapp/bot')
const { createBot, CoreClass } = require('../index')
class MockFlow {
find = () => {}
}
class MockDB {
listHistory = []
save = () => {}
}