Introduction
Bots today are an essential part of Customer help services. With services used by millions of people, itβs difficult for Customer service people to handle all the problems addressed to them. Bots can be easily built and integrated into any services if you are using the Wayscript Platform. So today, we are going to build a Customer help Bot for Slack.
Prerequisites
No prerequisites for this tutorial. However, you can read about the module we are going to use in this post.
Slack Trigger
When someone writes a message in the help channel, weβll capture the message and perform actions on it, and later send a response. For this purpose, weβll use the Slack Trigger.
Well, The trigger will depend on the action I add on the Slack channel. Itβs a pinned message.
So basically we have three actions. But first, we have to configure the Trigger.
We want to receive actions in A, B or C.
For the output, be sure to have Slack_Message_Text selected. This variable contains the message the user sent.
Java Module
WayScript allows you to write programs with Python, JavaScript, or Java if you want to perform more complex tasks. Here weβll work with Java.
Add it as a new module.
Once itβs done, click on Edit Code. We will write a script to perform actions on the Slack message weβve received.
Here nothing complex. I used Switch expression for more visibility and simplicity. By default, if we have no valid option, weβll just ask the user to provide the right message.
Click on Done Editing when finished. Weβll move the Slack Bot and configure it.
Slack Bot
Wayscript provides a Slack module you can use to read or write messages. Then, we can use this module to create the Slack Help Bot.
Once itβs added and you have configured the workspace, be sure to have a separate channel for this bot. In my case, I called it help.
Now, we can add inputs. Most importantly, we need the name of the Bot and the message. You can add an image to if you want to give a face to your Bot. ;)
Great! The Bot is ready, and if youβve followed exactly this tutorial, your result will look like this.
Conclusion
Questions about this script or anything else? Join our Discord. We're always around to help. If you want to work with the full script template, just find it here.
Top comments (0)