Skip to content

Commit

Permalink
Merge pull request #77 from drumenov/ChatOps-Course
Browse files Browse the repository at this point in the history
Suggestion for transcript changes for the ChatOps course.
  • Loading branch information
dtauer committed May 21, 2024
2 parents 86a0cb1 + 10c4961 commit 5d26c50
Show file tree
Hide file tree
Showing 28 changed files with 134 additions and 134 deletions.
12 changes: 6 additions & 6 deletions en-US/2023-08-25-chat-apis/1-project-overview.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[00:00:00]
>> What we're gonna build today is we're gonna build a custom bot for slack. That custom bot is going to feature a slash command, which will allow someone to say I have a request and that that request is going to take user input and save that user input to notion.
>> What we're gonna build today is we're gonna build a custom bot for slack. That custom bot is going to feature a slash command, which will allow someone to say I have a request and that request is going to take user input and save that user input to notion.

[00:00:16]
We're also gonna have a context shortcut so the little three dots on a message. Where you can drop that down and then click a process reminder so that the bot will tell somebody like, hey, this looks like it's a request. If you want us to measure this, you've got to put it into the request form, here's the slash command to make that happen.
Expand All @@ -26,7 +26,7 @@ This is one of the things that gets really challenging when you start building w
And have it up on a production URL for testing which makes it so slow and so frustrating, so instead what we're gonna do is we're gonna use a live tunneling service. That will allow us to keep up a local development environment running, but also give it a live URL so that we can test as we go.

[00:02:41]
We're gonna use serverless functions to power our command so that we can keep it free. Our bot does not need to be constantly running. Our bot is all based on incoming requests. So you're gonna run a slash command which says, hey bot, that'll wake the bot up. You've got the cron job, which is gonna be running on a regular schedule, so that'll wake the bot up, and each of these things is something that is on a like a poll basis.
We're gonna use serverless functions to power our command so that we can keep it free. Our bot does not need to be constantly running. Our bot is all based on incoming requests. So you're gonna run a slash command which says, hey bot, that'll wake the bot up. You've got the cron job, which is gonna be running on a regular schedule, so that'll wake the bot up, and each of these things is something that is on a like a pull basis.

[00:03:05]
We don't need the on a push basis, sorry. We don't need the command to be listening or reading every message or anything like that, it's so we'll use a serverless function, keep it free. Cron jobs are gonna be used to handle our weekly reminders and, this is gonna be based on a few accounts so the first thing is we're gonna be working from a GitHub repo.
Expand All @@ -47,16 +47,16 @@ Again, everything that we're using today is gonna be on free tier, so no paid ac
Again, you could use ngrok and then any serverless functions provider that you wish, this is not a workshop that's like tied to this specific account. This is just the way that I found that is the fastest and least painful to get things set up. The free tier of these services are gonna be all you need, again, just as a reminder, tools that you gonna need, you gonna need git on your computer.

[00:05:13]
You gonna need Node v16 higher, the Netlify CLI is how we're gonna set up that live tunnel, so y'all gonna need that. You'll need permission to clone repos and run third-party code to your computer before you get started, make sure that you have permission to clone, and push to GitHub repos.
You gonna need Node v16 higher, the Netlify CLI is how we're gonna set up that live tunnel, so y'all gonna need that. I will walk you through in setting up that part. You'll need permission to clone repos and run third-party code on your computer. If you are on a work computer that can sometimes be an issue if your computer is really locked down. So, double check that before you get started, make sure that you have permission to clone, and push to GitHub repos.

[00:05:38]
So a few things that I'll be using that aren't required for this but just to give some context on on the stack that I use. VS code is what I'll be using is both my code editor and as my terminal I like it, you can use whatever you want.
So a few things that I'll be using that aren't required for this but just to give some context on the stack that I use. VS code is what I'll be using is both my code editor and as my terminal I like it, you can use whatever you want.

[00:05:52]
GitHub CLI, I use this for managing repos, it's delightful to use, i love it, you don't need it, but that's what I'll be using whenever you see the GH command, that's the GitHub CLI. And again, these are my preferences they're not requirements you can work with or without these of you if you wish.
GitHub CLI, I use this for managing repos, it's delightful to use, i love it, you don't need it, but that's what I'll be using whenever you see the GH command, that's the GitHub CLI. And again, these are my preferences they're not requirements you can work with or without these if you wish.

[00:06:11]
Some assume knowledge, what I assume you're gonna know as I go through this workshop, some intermediate knowledge of JavaScript, so, nothing super in-depth. This isn't gonna be like an algorithms whiteboard interview or anything. But what I will be assuming is that you understand the basic grammar of the language, you know, how to set up, how to create variables, how to create functions, how to do a loop and things like that.
Some assumed knowledge, what I assume you're gonna know as I go through this workshop, some intermediate knowledge of JavaScript, so, nothing super in-depth. This isn't gonna be like an algorithms whiteboard interview or anything. But what I will be assuming is that you understand the basic grammar of the language, you know, how to set up, how to create variables, how to create functions, how to do a loop and things like that.

[00:06:33]
It just, we won't do like an intro to JavaScript as part of this workshop. We'll be sending and receiving data via API, and I'm not gonna go deep into the specifics of that, so we'll be using the Fetch API. If you've never used the Fetch API, the docs are on the Mozilla developer network, the MDN docs, so go check those out, but you won't need the depth of it.
Expand Down
18 changes: 9 additions & 9 deletions en-US/2023-08-25-chat-apis/1-project-overview.vtt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ to say I have a request and

4
00:00:10.865 --> 00:00:16.244
that that request is going to take user
that request is going to take user
input and save that user input to notion.

5
Expand Down Expand Up @@ -268,7 +268,7 @@ schedule, so that'll wake the bot up,
56
00:03:01.897 --> 00:03:05.969
and each of these things is something
that is on a like a poll basis.
that is on a like a pull basis.

57
00:03:05.969 --> 00:03:08.473
Expand Down Expand Up @@ -444,16 +444,16 @@ the Netlify CLI is how we're
92
00:05:18.098 --> 00:05:22.441
gonna set up that live tunnel,
so y'all gonna need that.
so y'all gonna need that. I will walk you through in setting up that part.

93
00:05:22.441 --> 00:05:26.306
00:05:22.441 --> 00:05:26
You'll need permission to clone repos and

94
00:05:26.306 --> 00:05:32.102
run third-party code to your
computer before you get started,
run third-party code on your
computer. If you are on a work computer that can sometimes be an issue if your computer is really locked down. So, double check that before you get started,

95
00:05:32.102 --> 00:05:38.563
Expand All @@ -468,7 +468,7 @@ that aren't required for this but
97
00:05:42.353 --> 00:05:45.224
just to give some context
on on the stack that I use.
on the stack that I use.

98
00:05:45.224 --> 00:05:48.876
Expand Down Expand Up @@ -501,11 +501,11 @@ they're not requirements you can work with

104
00:06:10.026 --> 00:06:11.913
or without these of you if you wish.
or without these if you wish.

105
00:06:11.913 --> 00:06:15.590
Some assume knowledge, what I assume
Some assumed knowledge, what I assume
you're gonna know as I go through this

106
Expand Down
18 changes: 9 additions & 9 deletions en-US/2023-08-25-chat-apis/10-handling-a-shortcut.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[00:00:00]
>> So now that we've got the the bot responding to the slash command and kind of putting the details from the payload from the user input back into chat, we wanna do one more thing before we start dealing with saving that input. Which is, if somebody's not following our process, which is pretty common on teams that I've been on, it's it's pretty standard for somebody to kind of fly in from a meeting and say, hey, I don't really like chocolate.
>> So now that we've got the bot responding to the slash command and kind of putting the details from the payload from the user input back into chat, we wanna do one more thing before we start dealing with saving that input. Which is, if somebody's not following our process, which is pretty common on teams that I've been on, it's pretty standard for somebody to kind of fly in from a meeting and say, hey, I don't really like chocolate.

[00:00:27]
If I can type. And in this case, they're starting a food fight but in a work context, they would be saying, hey, we need x or y. We need your help with this. We were working on x launch. And the message flies into Slack, and then who's responsible for keeping up on that, right?
Expand All @@ -14,13 +14,13 @@ But doing it this way it's a tiny conflict even if it's not actually that tense
And that drains energy, it uses up some of your spoons and leaves you with less in the tank to do your job. So a better way to do this is to let a robot do it for us. So we are going to add a context menu shortcut, so that we can ask people without having to type anything to them.

[00:01:42]
We just wanna be able, instead of having to do it this way. We wanna open up this menu here, and then ask them to do a thing. So, to handle that, we're going to go back to the browser. And we're gonna get into our interactivity in shortcuts menu again, and we're gonna create a new one.
We just wanna be able, instead of having to do it this way. We wanna open up this menu here, and then ask them to do a thing. So, to handle that, we're going to go back to the browser. And we're gonna get into our interactivity and shortcuts menu again, and we're gonna create a new one.

[00:02:02]
Now to create a new one, we want this to work on messages. So there's an option globally to just hit that little lightning bolt icon and it'll give you options of things you wanna do. But in our case, we're responding directly to a message, so we want this to be on Messages.

[00:02:15]
So we're gonna hit that hit next and then we are going to give it some details. So the details that we want to include our request to food fight and that's gonna be what shows up in the menu. And then we wanna have a short description and this is going to be something that just kind of gives some details on on why you would use this context menu.
So we're gonna hit that hit next and then we are going to give it some details. So the details that we want to include our request to food fight and that's gonna be what shows up in the menu. And then we wanna have a short description and this is going to be something that just kind of gives some details on why you would use this context menu.

[00:02:38]
So, did your coworker just offend your food sensibilities? Ask them to start a food fight so you can lay into them for eating incorrectly. And then as a callback ID, this can be anything you want as long as it's unique, and I'm gonna call this one start food fight nudge.
Expand All @@ -38,28 +38,28 @@ Then we can collapse these so that we can focus on just the piece that we're wor
Next, we wanna know who was the person that needs to be nudged because we're gonna tag them. So user id, and that's gonna come out of the payload user id. Then we need to know what the thread is that we're in because what we're doing is we're going to send this as a response to their message in a thread as opposed to a public channel, which it's just a little bit more subtle than like publicly blasting somebody for not following the process.

[00:04:27]
We do want it to be public so that people can see that there is a process and it needs to be followed. But we don't need to do the the main channel, at user put them on blast kind of thing. So we're gonna grab the thread time stamp and there are two places that can come from.
We do want it to be public so that people can see that there is a process and it needs to be followed. But we don't need to do the main channel, at user put them on blast kind of thing. So we're gonna grab the thread timestamp and there are two places that can come from.

[00:04:43]
If you are already in a thread, there's gonna be the the parent thread timestamp, and if you are replying to a message with its first reply, you're just gonna use the message timestamp itself. So we're gonna check if it's in a thread first, that's payload message thread timestamp.
If you are already in a thread, there's gonna be the parent thread timestamp, and if you are replying to a message with its first reply, you're just gonna use the message timestamp itself. So we're gonna check if it's in a thread first, that's payload message thread timestamp.

[00:04:59]
And if that doesn't exist, we're gonna get the payload message timestamp. With those details, we can send our message, so we're gonna await slack API. We're gonna use the chat.postMessage, and what we wanna send is the channel, so that's where it's going, the thread ts, so that it goes into the right reply, and then we need to set up our text.
And if that doesn't exist, we're gonna get the payload message timestamp. With those details, we can send our message, so we're gonna await Slack API. We're gonna use the chat.postMessage, and what we wanna send is the channel, so that's where it's going, the thread ts, so that it goes into the right reply, and then we need to set up our text.

[00:05:22]
And so this is going to be just a nudge to remind somebody that like, hey, you should use the process. So we'll say, hey and tag them and that's their user id. And again, these pointy boys are a way of slack letting you link in a not markdown, but they call it markdown way.
And so this is going to be just a nudge to remind somebody that like, hey, you should use the process. So we'll say, hey and tag them and that's their user id. And again, these pointy boys are a way of Slack letting you link in a not markdown, but they call it markdown way.

[00:05:45]
And we can say an opinion like this one deserves a heated public debate. Run the and then we wanna use some backticks here so we're gonna escape them and we'll say slash food fight. Wanna make this wrap. Food fight slash command in a main channel to start one.

[00:06:13]
And I call out main channel because slash commands don't work in threads, which is a little bit of a pain. And it's a bit confusing because like the Jiffy command does work in threads, but that's a special case that Slack. They just decided that that was the way things were gonna be.
And I call out main channel because slash commands don't work in threads, which is a little bit of a pain. And it's a bit confusing because like the "giphy" command does work in threads, but that's a special case that Slack. They just decided that that was the way things were gonna be.

[00:06:28]
There's no way to make your app work in a thread so you just have to nudge people to go back to the main thread. If they do try to use it in a thread, it will tell them that. So it's not a big deal, it's just a thing to be aware of.

[00:06:40]
So I'm gonna save this, And now if I go back out to the slack instance, I'm gonna refresh by hitting Cmd+R, because sometimes it takes a second for this to load. I have two of these for reasons I don't understand. But the one that we just added is the top one here, and that is going to show our message.
So I'm gonna save this, And now if I go back out to the Slack instance, I'm gonna refresh by hitting Cmd+R, because sometimes it takes a second for this to load. I have two of these for reasons I don't understand. But the one that we just added is the top one here, and that is going to show our message.

[00:07:05]
So it created a thread, it tagged the person who made the request, and it gives them a next step. So this is a nice little process nudge that gives people a clue of what they should be doing next, right? So again, you're just trying to take that mental burden, that emotional burden off of somebody of having to go in and be the process cop.
Expand Down
22 changes: 11 additions & 11 deletions en-US/2023-08-25-chat-apis/10-handling-a-shortcut.vtt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WEBVTT
1
00:00:00.140 --> 00:00:04.533
So now that we've got the the bot
So now that we've got the bot
responding to the slash command and kind

2
Expand All @@ -22,7 +22,7 @@ process, which is pretty common on teams

5
00:00:17.676 --> 00:00:21.109
that I've been on, it's it's pretty
that I've been on, it's pretty
standard for somebody to kind of

6
Expand Down Expand Up @@ -146,7 +146,7 @@ we're going to go back to the browser.
31
00:01:56.470 --> 00:01:59.901
And we're gonna get into our interactivity
in shortcuts menu again, and
and shortcuts menu again, and

32
00:01:59.901 --> 00:02:02.160
Expand Down Expand Up @@ -197,7 +197,7 @@ and this is going to be something that

42
00:02:33.484 --> 00:02:38.120
just kind of gives some details on on
just kind of gives some details on
why you would use this context menu.

43
Expand Down Expand Up @@ -344,7 +344,7 @@ it needs to be followed.
73
00:04:32.133 --> 00:04:35.122
But we don't need to do
the the main channel,
the main channel,

74
00:04:35.122 --> 00:04:37.727
Expand All @@ -353,7 +353,7 @@ at user put them on blast kind of thing.
75
00:04:37.727 --> 00:04:40.644
So we're gonna grab
the thread time stamp and
the thread timestamp and

76
00:04:40.644 --> 00:04:43.259
Expand All @@ -362,7 +362,7 @@ there are two places that can come from.
77
00:04:43.259 --> 00:04:47.912
If you are already in a thread, there's
gonna be the the parent thread timestamp,
gonna be the parent thread timestamp,

78
00:04:47.912 --> 00:04:51.101
Expand Down Expand Up @@ -391,7 +391,7 @@ get the payload message timestamp.
83
00:05:06.973 --> 00:05:11.220
With those details, we can send our
message, so we're gonna await slack API.
message, so we're gonna await Slack API.

84
00:05:11.220 --> 00:05:13.757
Expand Down Expand Up @@ -424,7 +424,7 @@ that's their user id.
90
00:05:36.270 --> 00:05:41.255
And again, these pointy boys
are a way of slack letting you
are a way of Slack letting you

91
00:05:41.255 --> 00:05:45.954
Expand Down Expand Up @@ -467,7 +467,7 @@ which is a little bit of a pain.
99
00:06:19.110 --> 00:06:23.966
And it's a bit confusing because like
the Jiffy command does work in threads,
the "giphy" command does work in threads,

100
00:06:23.966 --> 00:06:26.406
Expand Down Expand Up @@ -501,7 +501,7 @@ it's just a thing to be aware of.
106
00:06:40.760 --> 00:06:46.626
So I'm gonna save this, And now if I
go back out to the slack instance,
go back out to the Slack instance,

107
00:06:46.626 --> 00:06:49.321
Expand Down

0 comments on commit 5d26c50

Please sign in to comment.