This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "options": { | |
| "listenKeywords": false | |
| }, | |
| "uuid": "__LINK_0__", | |
| "name": "Bienvenida y Ofertas Iniciales", | |
| "label": "Nuevo Flow", | |
| "sort": 0, | |
| "sensitive": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "uuid": "__LINK_0__", | |
| "name": "CAL/Pregunta Fecha", | |
| "label": "Nuevo Flow", | |
| "sort": 0, | |
| "sensitive": false, | |
| "keyword": [ | |
| "EVENTS.ACTION" | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createBot, createProvider, createFlow, addKeyword } from '@builderbot/bot' | |
| import { MemoryDB as Database } from '@builderbot/bot' | |
| import { TelegramProvider as Provider } from '@builderbot-plugins/telegram' | |
| const PORT = process.env.PORT ?? 3008 | |
| const welcomeFlow = addKeyword<Provider, Database>(['hi', 'hello', 'hola']) | |
| .addAnswer(`🙌 Hello welcome to this *Chatbot*`) | |
| .addAnswer( | |
| [ | |
| 'I share with you the following links of interest about the project', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "uuid": "__LINK_0__", | |
| "name": "AI: Asistente", | |
| "label": "Nuevo Flow", | |
| "sort": 0, | |
| "sensitive": false, | |
| "keyword": [ | |
| "EVENTS.ACTION" | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "uuid": "__LINK_0__", | |
| "name": "Tarjeta", | |
| "label": "Nuevo Flow", | |
| "sort": 0, | |
| "sensitive": false, | |
| "keyword": [ | |
| "tarjeta", | |
| "targeta" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "My workflow", | |
| "nodes": [ | |
| { | |
| "parameters": { | |
| "options": {} | |
| }, | |
| "id": "32a160fa-88df-41dd-9949-18d98a70574d", | |
| "name": "When chat message received", | |
| "type": "@n8n/n8n-nodes-langchain.chatTrigger", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "uuid": "random", | |
| "name": "Bienvenida y Ofertas Iniciales", | |
| "label": "Nuevo Flow", | |
| "sensitive": false, | |
| "keyword": ["buenas", "hola", "hello"], | |
| "answers": [ | |
| { | |
| "options": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{ (() => { | |
| const gap = 45 | |
| const startDate = new Date($json["body"]["startDate"]); | |
| const endDate = new Date(startDate.getTime() + (gap * 60 * 1000)); | |
| const formatNumber = (num) => (num < 10 ? '0' : '') + num; | |
| const formattedDate = endDate.getFullYear() + '/' + | |
| formatNumber(endDate.getMonth() + 1) + '/' + | |
| formatNumber(endDate.getDate()) + ' ' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { generateExternalApiKey } = require('./generate-external-key'); | |
| const generateBodyContainer = (tenant = {}) => { | |
| const { botName, userId, uuid, openAiKey } = tenant; | |
| const sessions = `${uuid}_sessions` | |
| const EXTERNAL_API_KEY = generateExternalApiKey(userId); | |
| const OPENAI_API_KEY = openAiKey ?? process.env.OPENAI_API_KEY | |
| return { | |
| Name: `${botName.replace(/\s+/g, '')}-${uuid}`, | |
| Image: process.env.CONTAINER_IMAGE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require('axios').default; | |
| const https = require('https'); | |
| class PortainerRequest { | |
| #axios = axios; | |
| #URL = process.env.PORTAINER_URL | |
| constructor() { | |
| this.#axios = axios.create({ | |
| httpsAgent: new https.Agent({ | |
| rejectUnauthorized: false |