#100DaysOfWeb in Python Transcripts
Chapter: Days 77-80: Twitter and Slack bots
Lecture: Create a Slack app and slash command

Login or purchase this course to watch this video and the rest of the course contents.
0:00 What we first want to do is to make a Slack application. I go to add an app build, start building and I get a popup to create a Slack app.
0:20 And let's call it Book. Actually, if you join PiBytes in Day 4 you can test this out by adding an app to a workspace. Although, maybe I might regret it
0:32 if I get 100 app requests now, but it's fine. I've created the app and we're going to do a slash command create new command
0:45 and we're going to call it /book. And this will be the server endpoint that will be called when I call my slash command.
0:53 So, /book, this is what's getting called and we don't notice yet, because it will be localhost. That is where ngrok is coming in.
1:01 That will convert my localhost to a IP or hostname that's accessible via the internet and that's the address we're going to put here.
1:14 If the book would have arguments I could list it in here but that's not really the case because it's really only /book.
1:21 We're going to keep it very simple and in Day 4 you can expand the app, or build another one. So, this is it for now. Okay, cannot be empty
1:30 so let me just put a placeholder for now. And I'm going to replace that with the ngrok address later. Next I go back to basic information
1:48 and we see that the features and functionality bit is done. Now I need to install the app in my workspace and for that I need to request approval
1:58 because the nice thing is that any user on our PiBytes Slack can add apps, but of course the admins need to approve it.
2:05 So, I'm going to click request approval. And I go to my admin account and get back when I approved it. And just for your information
2:22 I made a print screen how that would look on my PiBytes admin account and I got this notification from the bot tester user.
2:29 He likes to install an app, I clicked approved. And as the user I get a message that the app now has been approved.
2:38 So, let me go back to the Slack page, refresh and now I got an installed app to workspace. Authorize and that's also done.
3:00 And we don't really need to manage distribution. I'm not going to share it to other workspaces for now. And that concludes the requirements
3:08 to build an app and a slash command so now we can start writing some code.


Talk Python's Mastodon Michael Kennedy's Mastodon