To make Iris understand variations of text and understand the user's intent, we will now run all questions asked through the natural language processor.
- [Instructor] What's the best way…to add Wit to our project?…The easiest way would be to simply add this API request…into handleOnMessage on slackClient here.…While this seems legit, it means tight coupling…between the natural language processing API we use…and the slackClient itself.…What if we later decide to use another service for that…or to implement the language processing part locally?…So I'd rather move this into a dedicated module…and pass it into slackClient as language processing service…to be used.…
So let's create a file witClient.js…in our Server folder.…Right-click on Server, select New File,…then type in witClient.js.…On top of it, we will again add use strict.…And now we will use another way of initiating a function.…This time, we will use a different pattern…as in slackClient to initialize a module.…
So we add module.exports equals function,…we call it witClient,…and it takes a token.…Now let's create an inner function or closure.…So we define the variable,…ask equals function ask,…and this function takes a message.…
After explaining some basics about Node.js and microservices, Daniel shows you how to sketch out the planned architecture for your application and get the boilerplate code, modules, and credentials in place. Next, he shows how to create a bot user in Slack, connect to Slack, and post messages. He also shows you how to get your bot to process variations in text by creating logic that delegates the processing of intent to dedicated modules. Lastly, he shows how to register additional services and he covers how to use monitoring to identify architectural or performance issues.
- Using Slack APIs
- Sketching out a Slack bot architecture
- Setting up a project and choosing modules
- Creating and naming your bot
- Connecting to Slack
- Setting up and using natural language processing
- Routing by intents
- Implementing geocoding and time calculation
- Adding and monitoring services