Bot Builder

Bot Builder is a platform for creating and deploying chatbots that automate communication and interaction with users. Companies can design conversational bots to handle customer inquiries, provide support, gather information, or assist with tasks such as appointment bookings, order processing, or lead management. The platform typically includes tools for designing chatbot workflows, setting triggers, and integrating the bot into various communication channels like websites, social media, or messaging apps. Bot Builder is particularly useful for companies looking to automate customer service, improve user engagement, and optimize recurring processes without extensive programming knowledge.

Installation

Via NPM

npm i @seven.io/botbuilder-adapter

Via Yarn

yarn add @seven.io/botbuilder-adapter

Setup

  1. 1

    Set API Key

    Set an environment variable named SEVEN_API_KEY containing your YOUR_API_KEY.

  2. 2

    Set Inbound Number

    Set an environment variable named SEVEN_INBOUND_DE containing your inbound number.

  3. 3

    Set Recipient

    Set an environment variable named SEVEN_RECIPIENT containing the recipient number.

Usage

import {ok} from 'assert';
import {Botkit} from 'botkit';
import {SevenAdapter} from '../src';

const {
    SEVEN_API_KEY,
    SEVEN_INBOUND_DE,
    SEVEN_RECIPIENT,
} = process.env

ok(SEVEN_API_KEY); // an API key from seven.io
ok(SEVEN_INBOUND_DE); // a phone number seven.io
ok(SEVEN_RECIPIENT);

const controller = new Botkit({
    adapter: new SevenAdapter({
        api_key: SEVEN_API_KEY,
        seven_number: SEVEN_INBOUND_DE,
    }),
});

// Triggering the process by sending an SMS
controller.spawn().then(async bot => {
    await bot.startConversationWithUser(SEVEN_INBOUND_DE);

    await bot.say('I want to chat with you!');
}).catch(console.error);


// Wait for and reply to incoming SMS
controller.on('message', async (bot, message) => {
    console.log('onMessage', message.incoming_message);

    await bot.reply(message, 'I am ready for a conversation!');
});
Last updated: 5 days ago