Cliq Bots - How to involve bots in your conversation and increase productivity?

Cliq Bots - How to involve bots in your conversation and increase productivity?

Cliq bots share a few similarities to Cliq users; that is all bots have a profile where you can set their display pictures, a status and can be mentioned in a conversation too! Just typing ' @ ' followed by the bot name will mention the bot in a conversation. We're drawing this analogy here to convey the idea behind a bot's mention handler. This handler is prompted to act when a bot is mentioned by a user in a conversation. 

What happens when you mention a bot?
 
The handler will enable the bot to perform an action it is programmed to do so. During this execution, the bot handler receives a list of attributes. Learn more about these attributes in the bot mention handler help page

For example, " @geekbot give me some interesting fact!" 

The bot response would look something like this - "Did you know? The character Mario from the video game Mario Bros is best known as a plumber. But he originally debuted as a carpenter in the game Donkey Kong." 

The geekbot's mention handler is triggered to respond to the conversation with an interesting fact. How? The bot identifies the keywords to give an appropriate answer if the keywords do not match, then you don't get a fact. As simple as that!

Sample Scenario Illustration 

Let us try to build a bot for the support team of an organization. A typical work day for any support executive will consist of handling multiple chats and replying to tons of emails. How can a bot be helpful as an assistant here? When a support agent is trying to discuss a request raised by a customer, the agent simply @mentions the TicketBot to get details about this ticket. The bot posts the response in a message card in the same conversation for everybody to see!

The TicketBot 's mention handler code is shown below. Take a look!

  1. response = Map();
  2. userinput = message;
  3. if(userinput.containsIgnoreCase("#"))
  4. {
  5. ticketID = userinput.subString(userinput.indexOf("#"));
  6. id = ticketID.subString(0,ticketID.indexOf(" "));
  7. ticket = zoho.support.searchRecords("Requests","Zylker","ZylCal","Request Id",id,1,10,"desk","true");
  8. if (ticket.size() > 0)
  9. {
  10. response = {"text":"Details for the ticket " + id,"card":{"theme":"modern-inline"},"slides":{{"type":"label","data":{{"Ticket Status":ticket.toMap().get("Status")},{"Contact Name":ticket.toMap().get("Contact Name")},{"Contact Email":ticket.toMap().get("Email")},{"View More Details":"[Take me to desk!](https://desk.zoho.com" + ticket.toMap().get('URI') + ")"}}}}};
  11. }
  12. else
  13. {
  14. response = {"text" : "Hey! Looks like the ticket ID is invalid. :neutral:"};
  15. }
  16. }
  17. else
  18. {
  19. response = {"text":"Hi There! \n I can get you the ticket details for any ticket. Just try mentioning me followed by the #ticketID. Just like this: *@salesbot* give me details about *#12345*","card":{"theme":"prompt"}};
  20. }
  21. return response;





Key Points to Note 
  • zoho.support.searchRecords is the deluge task to get a record from Zoho Desk. To learn more about this task refer the searchRecords help page. The format of this deluge task is 
  1. records = zoho.support.searchRecords("<Module_Name>","<Organization_Name>","<Department_Name>","Status","Open",1,10,"<Connection_Link_Name>", User_Access);
  • In the code snippet, ' desk ' is the connection link name, created for Zoho Desk and Zoho Search. If you're looking to create a bot that integrates with other products or within Zoho, then you'll have to create a connection. Learn how to create connections here
  • This code in mention handler is invoked when the bot is mentioned in any conversation. The response is posted in the same conversation by the bot. 
  • To structure the response of the bot as a message card, refer this help page
The bot mention handler is a great way to ask your bot to do custom tasks for you or your team and also to involve your bot in group conversations. So start building your bot mention handler right away!

Comments and suggestions are welcome!
 

Best,
Manasa
Cliq

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • Convert a message on Cliq into a task on Zoho Connect

                                                Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
                                              • Cliq Bots - Post message to a bot using the command line!

                                                If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how
                                              • Cliq Bots - How to make a bot respond to your messages?

                                                Bots are just like your buddies with whom you can interact. They carry out your tasks, keep you notified about your to-dos and come in handy when you need constant updates from a third party application.  So, how can you make your bot respond to a message? The bot message handler is a piece of code triggered when a message is sent to the bot. Message handlers help you customise your bot responses to make it look conversational. The message input from the user can be either a string or an option selected
                                              • Cliq Bots - Get notifications about any action on an application with the incoming webhook handler!

                                                Webhooks can be used to get notified about events happening in other applications inside Cliq. All bots in Cliq have their own incoming webhook endpoint. This makes it simple to post messages to the bot from external applications. Unlike the send message
                                              • The Slash Command Series - Types of Command Suggestions

                                                Hi Everybody! I hope you guys tried the /zdocs command and now have an idea of how command suggestions with click to execute work. If you have no clue of what command suggestion is, I recommend you to take a look at all the Slash Command Series posts, especially the one on Command Suggestions ! This post is all about the different types of command suggestions.  Customise your command suggestions  Did you know you could customise your command suggestion list with a title, description, image? Well,


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now