Hackpack for VandyHack's Slackbot workshop on July 11th. This bot's functionality includes creating task reminders and group polls.
A bot is both a system user and an application operating inside an infrastructure. Bots are particularly useful for performing small, repetitive tasks in user workspaces.
A Slackbot is simply a type of Slack App that interacts with users via conversation.
An Application Programming Interface (API) is a software intermediary that allows two applications to talk to each other. An API specifies how software components should interact by providing a set of pre-implemented methods/variables/classes for building software applications. For example, the Slack APIs are used for Slack app development.
- Slash command: acts as a shortcut that triggers messages or actions from Slack, an app, or an integration
- Message payload: a JSON object that is used to define metadata about the message, such as its visual composition and where it should be published
This bot responds to four slash commands:
-
/pat
- Creates a reminder for a channel; usage hint:/pat [timeString] , [message]
-
/pat2
- Creates a reminder for a specific user; usage hint:/pat2 [@user] [time] , [message]
-
/newpoll
- Creates a new poll in a channel; usage hint:/newpoll [pollQuestion]? [option1] , [option2] , ...
-
/closepoll
- Closes the current poll in a channel; usage hint:/closepoll
We used Bolt & Glitch to create this JavaScript-based Slackbot. Bolt is the official Node.js framework for JavaScript-based Slack app development. Glitch is a collaborative platform for creating, remixing and hosting web apps in real time.
app.js
contains the primary Bolt app. It imports the Bolt package (@slack/bolt
) and starts the Bolt app's server. It's where you'll add your app's listeners..env
is where you'll put your Slack app's authorization token and signing secret.- The
examples/
folder contains a couple of other sample apps that you can peruse to your liking. They show off a few platform features that your app may want to use.
Read the Bolt documentation & Getting Started guide
\ ゜o゜)ノ