How to make a slack bot

This article shows you how to make a slack bot.

Creating a bot account

Go to this URL https://api.slack.com/

スクリーンショット 2020-06-22 15.15.06.png

Press "Your Apps" in the upper right

At this point, the person who is displayed as "Go to Slack" cannot log in to the slack workspace, so let's log in.

If you press the button while logged in

スクリーンショット 2020-06-22 15.27.56.png

This screen will appear, so press "Create an App".

スクリーンショット 2020-06-22 15.37.27.png

Enter the app name and select the workspace you want to add.

You have now created a bot account.

Edit bot permissions

The created account is displayed near the center of the page, so click on it.

After that, click "OAuth & Permissions" in the left bar.

スクリーンショット 2020-06-22 16.01.46.png

You may need to make a note of the "Bot User OAuth Access Token" at the top center as you will need it later (you can also see it later).

スクリーンショット 2020-06-22 16.10.09.png

If you scroll down, there is an item called "Bot Token Scopes", so if you press the button "Add an OAuth Scope", you can give authority to the bot, so you need "channels: read" and "chats:" to create this bot. "write" is added.

At this time, you may be wondering, "Isn't it okay to add all the privileges?", But if you give all the privileges, the damage will be minimized when a malfunction occurs. Because.

Add a bot account to your workspace

If you select "OAuth & Permissions" and then select "Install App to Workspace" at the top "OAuth Tokens & Redirect URLs"

スクリーンショット 2020-06-22 16.23.00.png

A screen like this will appear, so select "Allow". You have now added the bot to your workspace.

Recommended Posts

How to make a slack bot
How to make a Japanese-English translation
Tweet in Chama Slack Bot ~ How to make a Slack Bot using AWS Lambda ~
How to make a crawler --Advanced
How to make a recursive function
How to make a deadman's switch
[Blender] How to make a Blender plugin
How to make a crawler --Basic
How to make a Cisco Webex Teams BOT with Flask
How to make a multiplayer online action game on Slack
[Python] How to make a class iterable
How to make a Backtrader custom indicator
How to make a Pelican site map
Create a slack bot
Slack --APIGateway --Lambda (Python) --How to make a RedShift interactive app
How to make a dialogue system dedicated to beginners
How to make a dictionary with a hierarchical structure.
How to make a QGIS plugin (package generation)
I read "How to make a hacking lab"
How to make a rock-paper-scissors bot that can be easily moved (commentary)
How to call a function
Make a LINE BOT (chat)
How to hack a terminal
How to make a shooting game with toio (Part 1)
How to make a Python package using VS Code
Basics of PyTorch (2) -How to make a neural network-
How to write a Python class
[Python] How to make a list of character strings character by character
How to put a symbolic link
How to make a hacking lab-Kali Linux (2020.1) VirtualBox 64-bit Part 2-
How to create a Conda package
How to create a virtual bridge
How to make a hacking lab-Kali Linux (2020.1) VirtualBox 64-bit edition-
How to make a Python package (written for an intern)
How to make a simple Flappy Bird game with pygame
How to create a Dockerfile (basic)
[Blender] How to make Blender scripts multilingual
A Python beginner made a chat bot, so I tried to summarize how to make it.
How to delete a Docker container
The world's most easy-to-understand explanation of how to make a LINE BOT (1) [Account preparation]
How to create a config file
How to make an interactive LINE BOT 004 (answer the closing date of a listed company)
How to make a string into an array or an array into a string in Python
How to make a command to read the configuration file with pyramid
How to make a surveillance camera (Security Camera) with Opencv and Python
[C language] How to create, avoid, and make a zombie process
Spigot (Paper) Introduction to how to make a plug-in for 2020 # 01 (Environment construction)
How to make a .dylib library from a .a library on OSX (El Capitan)
How to make a unit test Part.1 Design pattern for introduction
[Introduction] I want to make a Mastodon Bot with Python! 【Beginners】
[Python] How to make a matrix of repeating patterns (repmat / tile)
How to make Word Cloud characters monochromatic
Create a bot to retweet coronavirus information
How to split and save a DataFrame
How to build a sphinx translation environment
How to create a git clone folder
How to add a package with PyCharm
How to draw a graph using Matplotlib
Try to make a kernel of Jupyter
Send a message from Python to Slack
[Colab] How to copy a huge dataset