Creating a Slack App for our Custom Serverless Slack Bot

Creating a Slack App for our Custom Serverless Slack Bot#

In order to properly use this bot, we'll need a Slack workspace that we have admin over. If your slack admin has granted normal users permission to create apps in a workspace you have access to, that will also work.

It's possible to create new slack workspaces quickly and easily - without even providing a credit card. You'll just need an email that will be associated your slack login. For this course, I created a new, workspace called "PythonOnLambda". It takes less than 5 minutes to create a free slack workspace , so if you don't have your own slack workspace already - just follow the steps here to create one: https://slack.com/get-started#create

Create a Slack App for Dicebot#

From the web browser, ensure you are logged into slack as your admin slack user. Then, go to https://api.slack.com/apps and click the green button that says Create an App:

Slack Build App

We will be prompted to enter in a name for your new application and choose your slack workspace. Let's name it "Dicebot", and ensure we have the correct workspace selected.

Slack Define App

From the next page, we can configure the application settings.

Add Slack Slash Command#

We will select the "Add Slash Command" setting for our application now.

From this page, click "Create Slack Command"

Slack Fill in Slash Command

The configuration show be filled in as shown in the example below.

Command : The command that will invoke the bot API Example /roll

Request URL : Must be the full URL for the API GW, that was deployed in the Deploy Hello World step above. Example: https://RANDOMVALUE.execute-api.us-east-1.amazonaws.com/Prod/first/proxy

Short description : The description of the commands functionality Example: A dice rolling chat bot

Usage Hint : A reminder that will pop up when slack users type /roll Example: [NUMdSIDES]

Slack Message when Slash Command Added
Slack Update Perms

If you prompted, click the link in the yellow banner shown and then select a slack channel to be used with the dicebot next page.

If we try to run /roll at this point, you unfortunately won't get a working bot. But we're not far off now!

No discussions yet