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, MemoryDB, utils } from '@bot-whatsapp/bot' | |
| import { BaileysProvider } from '@bot-whatsapp/provider-baileys' | |
| const welcomeFlow = addKeyword(['hello', 'hi']).addAnswer('Ey! welcome') | |
| const emailValidationFlow = addKeyword(utils.setEvent('EMAIL_VALIDATION')) | |
| .addAnswer('¿Cual es tu nombre?', { capture: true }) | |
| .addAnswer('¿Cual es tu edad?', { capture: true }) | |
| .addAnswer('Gracias!!') |
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 typing = async function (ctx: any, provider: any) { | |
| if (provider && provider?.vendor && provider.vendor?.sendPresenceUpdate) { | |
| const id = ctx.key.remoteJid | |
| await provider.vendor.sendPresenceUpdate('composing', id) | |
| } | |
| } |
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
| #!/bin/bash | |
| # Actualizar la lista de paquetes disponibles | |
| sudo apt update | |
| # Instalar Nginx | |
| sudo apt install -y nginx | |
| # Comprobar si Nginx se instaló correctamente | |
| if [ $? -eq 0 ]; then |
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 { Document } from 'langchain/document'; | |
| import { readFile } from 'fs/promises'; | |
| import { BaseDocumentLoader } from 'langchain/document_loaders'; | |
| export abstract class BufferLoader extends BaseDocumentLoader { | |
| constructor(public filePathOrBlob: string | Blob) { | |
| super(); | |
| } | |
| protected abstract parse( |
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
| { | |
| "workbench.iconTheme": "moxer-icons", | |
| "workbench.colorCustomizations": { | |
| "tab.activeBorder": "#0077b6", | |
| "tab.unfocusedActiveBorder": "#000000", | |
| "tab.activeBackground": "#0077b6", | |
| "tab.hoverBackground": "#348cff" | |
| }, | |
| "highlight.regexes": { | |
| "((?:<!-- *)?(?:#|// @|//|./\\*+|<!--|--|\\* @|{!|{{!--|{{!) *TODO(?:\\s*\\([^)]+\\))?:?)((?!\\w)(?: *-->| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|<!--|@|--|{!|{{!--|{{!))|(?: +[^\\n@]*?)(?= *(?:[^:]//|/\\*+|<!--|@|--(?!>)|{!|{{!--|{{!))|(?: +[^@\\n]+)?))": { |
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 { ProviderClass } = require('@bot-whatsapp/bot') | |
| const TelegramBot = require("node-telegram-bot-api"); | |
| class TelegramProvider extends ProviderClass { | |
| vendor | |
| constructor({ token }) { | |
| super() | |
| this.vendor = new TelegramBot(token, { polling: true }); | |
| const listEvents = this.busEvents() | |
| for (const { event, func } of listEvents) { |
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 { CoreClass } = require('@bot-whatsapp/bot'); | |
| class ChatGPTClass extends CoreClass { | |
| queue = []; | |
| optionsGPT = { model: "gpt-3.5-turbo" }; | |
| openai = undefined; | |
| constructor(_database, _provider) { | |
| super(null, _database, _provider) |
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: publish | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| publish-hello-docker-image: | |
| runs-on: ubuntu-latest | |
| steps: |
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 { JWT } = require("google-auth-library"); | |
| const { GoogleSpreadsheet } = require("google-spreadsheet"); | |
| const SCOPES = [ | |
| "https://www.googleapis.com/auth/spreadsheets", | |
| "https://www.googleapis.com/auth/drive.file", | |
| ]; | |
| class GoogleSheetService { | |
| jwtFromEnv = undefined; |
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
| ```bash | |
| #!/bin/bash | |
| OPENAI_API_KEY='' | |
| ID_TENANT='' | |
| EXTERNAL_API_KEY='' | |
| CONTAINER_NAME='' | |
| PORT='' | |
| while getopts o:i:e:n:p: flag |