

Once your app is created you’ll be presented with the following default app dashboard. Once you have done this click on the Create App button. For this tutorial, name your app CoinBot and select a workspace you have admin access to. Next you’ll be prompted for the name of your app and to select a development Slack workspace. Log in to your workspace in Slack via a web browser and navigate to the API Control Panel.

Step 1 - Creating the Slackbot in the Slack UIįirst create your Slack app in the Slack API Control Panel. If you are looking for a way to develop on a cloud server, check out this tutorial on How To Use Visual Studio Code for Remote Development via the Remote-SSH Plugin. If you are testing on a local machine you will need to port forward traffic through your firewall to your local system. Slack will need to be able to send events such as messages to your bot. You may want to test this tutorial on a server that has a public IP address. You can follow this guide to initialize your server and complete these steps. We recommend a fresh installation of Ubuntu 20.04, a non-root user with sudo privileges, and SSH enabled. (Optional) A server or computer with a public IP address for development.

If you don’t already have one, you can create one on the Slack website. If you created the workspace you have this ability. In order to follow this guide, you’ll need:Ī Slack Workspace that you have the ability to install applications into. Note that this tutorial uses Python 3 and is not compatible with Python 2. You can then modify your CoinBot to fulfill any number of slightly more practical applications. Slack also provides a Python Slack Events API for integrating with events in Slack, allowing you to perform actions on events such as messages and mentions.Īs a fun proof-of-concept that will demonstrate the power of Python and its Slack APIs, you will build a CoinBot-a Slackbot that monitors a channel and, when triggered, will flip a coin for you. Slack provides a rich Python Slack API for integrating with Slack to perform common tasks such as sending messages, adding emojis to messages, and much more. Python is a popular language that prides itself on simplicity and readability. In this tutorial you will build a Slackbot in the Python programming language. A Slackbot is an automated program that can perform a variety of functions in Slack, from sending messages to triggering tasks to alerting on certain events.

It includes features such as direct messaging, public and private channels, voice and video calls, and bot integrations. Slack is a communication platform designed for workplace productivity. The author selected the Tech Education Fund to receive a donation as part of the Write for DOnations program.
