After having all boilerplate code, modules, and credentials in place, we start the main implementation phase by making a first connection to Slack.
- [Instructor] We set up a basic express application,…created a bot using Slack…and we an API token to connect to this bot user.…Now we are ready to add the Slack client…to our project and run it.…For that, let's review the documentation.…It tells us how to install the module.…So let's copy paste this from here…into our Visual Studio code terminal.…Paste it in here and type return.…Now we have added the Slack client to our project.…
Next let's review the documentation again.…It shows us how to create an RTM client.…RTM stands for real time messaging…in this devep socket protocol we explored before.…But where shall we put in this snippet?…You may be tempted to put it into service.js…because your express app lives there…and it would make sense to add the Slack logic here.…But our addition contains a run method…which will connect to Slack using web sockets.…
Do we really want to connect to Slack…each time we require the app?…A better place would be the run.js.…But I'd rather recommend to put it in a separate module.…
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