src/app.js

builderbot · starters/apps/base-js-email-memory/src/app.js · javascript · MIT
email

Example email bot using builderbot, demonstrating flows and provider integration.

// Source: https://github.com/codigoencasa/builderbot | License: MIT | Copyright 2022 Leifer Mendez
// Provided via justclaw.it.com; keep this notice with the code.
import { join } from 'path'
import { createBot, createProvider, createFlow, addKeyword, utils } from '@builderbot/bot'
import { MemoryDB as Database } from '@builderbot/bot'
import { EmailProvider as Provider } from '@builderbot/provider-email'

const PORT = process.env.PORT ?? 3008

const discordFlow = addKeyword('doc').addAnswer(
    ['You can see the documentation here', '📄 https://builderbot.app/docs \n', 'Do you want to continue? *yes*'].join(
        '\n'
    ),
    { capture: true },
    async (ctx, { gotoFlow, flowDynamic }) => {
        if (ctx.body.toLocaleLowerCase().includes('yes')) {
            return gotoFlow(reg

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key