/botkit-starter-slack

A customizable starting point for building multi-team Slack bots that use the latest APIs

Primary LanguageJavaScript

Botkit Starter Kit for Slack Bots

This repo contains everything you need to get started building a bot with Botkit and Botkit Studio!

Botkit Studio is a set tools that adds capabilities to the open source Botkit library by offering hosted GUI interfaces for script management and action trigger definition. Botkit Studio is built by the company that created and maintains the open source Botkit library, Howdy.

While Botkit Studio is not required to build a bot using Botkit, we highly recommend it as your bot will be easier to manage, customize and extend.

Instant Start

Remix this project on Glitch

Deploy to Heroku

Get Started

Clone this repository:

git clone https://github.com/howdyai/botkit-starter-slack.git

Install dependencies, including Botkit:

cd botkit-starter-slack
npm install

Set up a new Slack application via the Slack developer portal. This is a multi-step process, but only takes a few minutes. Read this step-by-step guide to make sure everything is set up.

Next, get a Botkit Studio token from your Botkit developer account

Update the .env file with your newly acquired tokens.

Launch your bot application by typing:

node .

Now, visit your new bot's login page: http://localhost:3000/login

Once successfully logged in, your bot should connect to Slack AND Botkit Studio and leap into action!

Continue your journey to becoming a champion botmaster by reading the Botkit Studio SDK documentation here.

Extend This Bot

This repo is designed to provide developers a robust starting point for building a custom bot. Included in the code are a set of sample bot "skills" that illustrate various aspects of the Botkit SDK features. Once you are familiar with how Botkit works, you may safely delete all of the files in the skills/ subfolder.

Developers will build custom features as modules that live in the skills/ folder. The main bot application will automatically include any files placed there.

A skill module should be in the format:

module.exports = function(controller) {

    // add event handlers to controller
    // such as hears handlers that match triggers defined in code
    // or controller.studio.before, validate, and after which tie into triggers
    // defined in the Botkit Studio UI.

}

Customize Storage

By default, the starter kit uses a simple file-system based storage mechanism to record information about the teams and users that interact with the bot. While this is fine for development, or use by a single team, most developers will want to customize the code to use a real database system.

There are Botkit plugins for all the major database systems which can be enabled with just a few lines of code.