Bots today are an important 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 Discord.
No prerequisites for this tutorial. However, you can read about the module we are going to use in this post.
- Working with Discord Trigger
- Working with conditionals
- Working with Discord module
When someone will write 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 Discord Trigger.
Well, The trigger will depend on the action I add on the discord channel. It’s a pinned message.
So basically we have three actions. But first, we have to configure the Trigger.
For the output, be sure to have Discord Message selected. This list contains information we’ll use to perform actions.
Here we have three conditions, but exactly four. A message will be displayed if the user hasn’t entered a valid action, I mean a valid action is A, B or C. Nothing else. First, add the If/Else module.
Once it’s done, we can add the conditions.
If you want to add another condition, just click on Add Else if.
Now we have different branches for our scenario. We are going to create a string variable where we’ll store the message we want to send.
Then in the first branch concerning action A, add Create Variable module.
And then add this variable and text message.
We are going to do the same for the second branch and the third branch.
Great. But it’s not finished yet. As I said earlier, we have four conditions. The Else will be executed if the message typed by the user is not equal to A, B, or C. Then we can add a custom message for this branch too.
Now that we have the text message, we can easily respond now via our Discord bot.
Wayscript provides a Discord module you can use to read or write messages. Then, we can use this module to create the Help Bot.
Once it’s added and you have configured the server, 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.
Feel free to clone this script and modify it as you want. You can create many actions as you can. The sky is the limit.
Questions about this script or anything else? Join our discord. We're always around to help. If you want to work the full script template, just find it here.
Top comments (0)