From the course: Building Bots with Node.js
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Creating sessions and threads on mentions - Node.js Tutorial
From the course: Building Bots with Node.js
Creating sessions and threads on mentions
- [Instructor] So, in this video, we will finally implement threaded sessions for Slack, and I'm still in routes/bots/slack.js. So as we know, we want to start a new session when our bot user is mentioned, so I head down to our handler function for mentions, and there I will first generate a session ID. Const sessionId equals createSessionId, so that's another helper function we created before. Event.channel, event.user, and then I will add event.thread_ts, so this applies when we are already in a thread, or if this message is not yet part of a thread but will become the root of the thread, we'll use event.ts. Let's remove the sidebar here. Next we're going to try to get the session from our session store, so I'll add let session equals sessionService.get, sessionId, and then if there is no existing session, this will return false, so if this is the case, I want to create a new session. So if there is no session,…
Contents
-
-
-
-
-
(Locked)
Creating conversational flows2m 49s
-
(Locked)
Creating a session management service6m 32s
-
(Locked)
Preparing to add threaded sesssions2m 4s
-
(Locked)
Creating sessions and threads on mentions4m 15s
-
(Locked)
Handling threaded messages3m 44s
-
(Locked)
Implementing a conversation service6m 40s
-
(Locked)
Adding conversation awareness to slack5m 1s
-
(Locked)
Training special and partial utterances7m 3s
-
(Locked)
Handling greetings and good byes4m 13s
-
(Locked)
-
-