Skip to content

noveogroup-amorgunov/typebot

Repository files navigation

typebot

Make your awesome bots in few steps!

  • Written with typescript
  • Very easy to use
  • Use custom session store, platform connector with same interface

Installation

You can install typebot

npm install @typebot/core --save

Examples

You can find a lot of examples in the examples folder 🚀.

Here is the simple example of usign typebot as the echo-bot. It always says what you said. There is used async/await function as message's handler.

const { ConsoleConnector, Bot } = require('@typebot/core');

 // Create "console" connector to listen process.stdin
const connector = new ConsoleConnector().listen();
const bot = new Bot({ connector });

// Middleware for handling messages
bot.use(async ({ session, message }, next) => {
    const text = message.getText(); // Get user's message
    
    await session.send(`> You said: ${text}`); // Send back
    
    next();
});

You can run script and type text to console:

hello bot
> You said: hello bot
yo
> You said: you

Another examples:

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published