Raniazy / tuto_slack_botkit_chatbot

This is a tutorial for building a slack chatbot using botkit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building a slack bot with Botkit

This is a tutorial for building a slack chatbot using botkit. (Based on some steps in the Kazuar tutorial)

I love Slack. I's my favorite meeting chat room. My interest in bots leaded me to write this tutorial where you'll see how simple it is to build your own chatbot in slack.

A bot is a piece of software designed to execute scripts to automate tasks that you would normally do on your own, such as make a dinner reservation, or update calendar appointment information. Often deployed inside messaging apps, chatbots are a popular way of handling customer service requests.

[Slack](https://slack.com/) has been interested in chatbots a while now. Here are the most popular bots in [Slack](https://slack.com/)

Polly by Subcurrent : Smart polls and automated feedback.

Statsbot : Analytics Companion for your slack team.

Howdy : your new digital coworker. Our bot will automate repetitive tasks so you can do the real work.

Meekan Scheduling Assistant : matches everyone’s calendars, and quickly finds common free times.

You will be building a chatbot that lives in slack messaging application with a well known framework : Botkit that was made by Howdyai and sold to Slack a few months ago.

##Building steps

1. Create a slack account If you don’t have one already, create one at Slack and start using it. … or work on something else :)

2. Regsiter a slack bot Go to https://slack.com/apps/build and click on “Make a Custom Integration” under “Something just for my team”

3. In the new page, click on “Bots”

4. Choose your new slack bot name (i.e. slack_bot) and press “Add bot integration”

5. In the new page, copy the API token of the new slack bot as we will need it in our script

##Prepare the environnement

As indicated, we will use the Botkit

###Installation

Install Node from here https://nodejs.org, this will be the server environment. Then open up Terminal or Command Line Prompt and make sure you've got the very most recent version of npm by installing it again:

  sudo npm install npm -g

Create a new folder somewhere and let's create a new Node project. Hit Enter to accept the defaults.

```
npm init
```

Botkit is available via NPM.

npm install --save botkit

You can also check out Botkit directly from Git. If you want to use the example code and included bots, it may be preferable to use Github over NPM.

git clone git@github.com:howdyai/botkit.git

After cloning the Git repository, you have to install the node dependencies. Navigate to the root of your cloned repository and use npm to install all necessary dependencies.

npm install

You should indicate your slack bot token you copied while creating the bot on Slack a few minutes ago.

to run the slack bot :

node slack_bot.js

See how easy it is to build your bot ? Now, the sky is your limit. You can create how many amazing bots as you can. advice: Check out the facebook messenger bots too, they're cool.

Contribute

Contributions are always welcome! Please read the contribution guidelines first.

License

CC0

To the extent possible under law, Rania ZYANE has waived all copyright and related or neighboring rights to this work.

About

This is a tutorial for building a slack chatbot using botkit.