feat(provider): 🐛 dialogflow

This commit is contained in:
Leifer Mendez
2022-12-16 15:33:15 +01:00
parent a52aaa11d8
commit 4ec6f1e120
11 changed files with 228 additions and 10 deletions

View File

@@ -0,0 +1,14 @@
const MockClass = require('./mock.class')
/**
* Crear instancia de clase Bot
* @param {*} args
* @returns
*/
const createBotMock = async ({ database, provider }) =>
new MockClass(database, provider)
module.exports = {
createBotMock,
MockClass,
}

View File

@@ -0,0 +1,24 @@
const { CoreClass } = require('@bot-whatsapp/bot')
/**
* Necesita extender de core.class
* handleMsg(messageInComming) // const { body, from } = messageInComming
*/
class MockContext extends CoreClass {
constructor(_database, _provider) {
super(null, _database, _provider)
}
init = () => {}
/**
* GLOSSARY.md
* @param {*} messageCtxInComming
* @returns
*/
handleMsg = async ({ from, body }) => {
console.log('DEBUG:', messageCtxInComming)
}
}
module.exports = MockContext