mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 04:29:16 +00:00
@@ -1,6 +1,6 @@
|
|||||||
const dialogflow = require('@google-cloud/dialogflow');
|
const dialogflow = require('@google-cloud/dialogflow');
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const nanoid = require('nanoid')
|
//const nanoid = require('nanoid')
|
||||||
/**
|
/**
|
||||||
* Debes de tener tu archivo con el nombre "chatbot-account.json" en la raíz del proyecto
|
* Debes de tener tu archivo con el nombre "chatbot-account.json" en la raíz del proyecto
|
||||||
*/
|
*/
|
||||||
@@ -30,7 +30,7 @@ const checkFileCredentials = () => {
|
|||||||
// Detect intent method
|
// Detect intent method
|
||||||
const detectIntent = async (queryText) => {
|
const detectIntent = async (queryText) => {
|
||||||
let media = null;
|
let media = null;
|
||||||
const sessionId = nanoid.nanoid()
|
const sessionId = 1
|
||||||
const sessionPath = sessionClient.projectAgentSessionPath(PROJECID, sessionId);
|
const sessionPath = sessionClient.projectAgentSessionPath(PROJECID, sessionId);
|
||||||
const languageCode = process.env.LANGUAGE
|
const languageCode = process.env.LANGUAGE
|
||||||
const request = {
|
const request = {
|
||||||
@@ -72,4 +72,4 @@ const getDataIa = (message = '', cb = () => { }) => {
|
|||||||
|
|
||||||
checkFileCredentials();
|
checkFileCredentials();
|
||||||
|
|
||||||
module.exports = { getDataIa }
|
module.exports = { getDataIa }
|
||||||
|
|||||||
Reference in New Issue
Block a user