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
    • Sticky Posts

    • Customer payment alerts in Zoho Cliq

      For businesses that depend on cash flow, payment updates are essential for operational decision-making and go beyond simple accounting entries. The sales team needs to be notified when invoices are cleared so that upcoming orders can be released. In contrast,
    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Accelerate Github code reviews with Zoho Cliq Platform's link handlers

      Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share
    • App Spotlight : PagerDuty for Zoho Cliq

      App Spotlight brings you hand-picked apps to enhance the power of your Zoho apps and tools. Visit the Zoho Marketplace to explore all of our apps, integrations, and extensions. In today's fast-paced world, seizing every moment is essential for operational
    • Automate your status with Cliq Schedulers

      Imagine enjoying your favorite homemade meal during a peaceful lunch break, when suddenly there's a PING! A notification pops up and ruins your moment of zen. Even worse, you might be in a vital product development sprint, only to be derailed by a "quick