How I built an HR Slack Bot with Node and Botkit - Deepstash
The Psychology Of The Ultimate Entrepreneur

Learn more about leadershipandmanagement with this collection

The importance of perseverance

How to embrace failure as a learning opportunity

The power of innovation and creativity

The Psychology Of The Ultimate Entrepreneur

Discover 128 similar ideas in

It takes just

17 mins to read

My Goals

My bot should be able to manage all the needs a small company could have on Slack:

  • Onboarding
  • Putting people in touch
  • Reminders
  • Announcements
  • Birthdays /Anniversary
  • And many more

2

0 reads

Reviewing the basics

For this program, I’ll use:

  • Botkit
  • Node JS
  • Express Server
  • MongoDB
  • Slack API & of course

2

0 reads

How do Slack bots work?

There are then two cases:

  • You want your bot to react to events happening directly in Slack
  • You want your bot to react to events happening on your server

2

0 reads

Getting Started

Below you’ll find my Server.Js file: This server is a blank page, showing and processing nothing. You’ll then need a slack App: just follow this link to create one. The Controller is the brain of your Bot. It contains every skill and configuration.

2

0 reads

Unlocking the first case: react to the events happening on Slack

If you give the right Permissions to your App, every time a message is sent on a channel, slacks sends a request to your server with some information. If we want our Bot to react to a simple message like "Hi", we have to give slack an address to send the information to. If we want our Bot to react every time it hears "hello", we can simply add This.Hears() Function to our Controller. If we want our Bot

2

0 reads

Second Case: initiate a conversation with your bot

A Cronjob firing every weekday at 9:00 am is below a Cronjob firing every weekday at 9:00 am. Thanks to the date() Method, the Bot gets today’s date and can compare it to the “Joineddate” of the user.

2

0 reads

CURATED BY

rachegraham

Designer graphic

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates