Cliq Bots - Create preset actions for your bot using the menu handler

Cliq Bots - Create preset actions for your bot using the menu handler

Menu Handler provides an easy way to trigger actions with just one click! Imagine a news bot having the list of categories as a menu, instead of asking the bot to get the news for a particular category, the user can click on any particular menu action and get the details. For example, a custom menu action 'Help' dedicated to educating the users about the bot's functionality and how to interact with the bot will provide to be of great use!

Working of the bot menu handler

The workflow for the menu handler is pretty straightforward. The handler is invoked to perform an action when a user selects a particular action from the menu list. The response is displayed to the user as a preview. Take a look at the list of attributes passed when the menu handler is triggered in our help page

Note:  Each bot can have a list of 5 custom actions!

Sample Scenario

Let us try creating a feedback menu action for a bot. On clicking this feedback action, the user should be able to send feedback or feature requests to the bot creator directly. This makes it easier for the user to give their feedback without going through the usual route of sending an email / filling a form! 

The following steps go into creating this feedback menu :
  • Configure the feedback menu action to post message on click
  • A function to work in association with the feedback button. 
  • Creating a connection with Cliq ( to post the feedback response from the user to the bot creator) 
Take a look at the sample code snippet for the bot menu handler: 

  1. response = Map();
  2. response =
  3. {  
  4.    "text": "Hi " + user.get("first_name") + " !Tell us what you think of Connect Bot and also give us suggestions on a feature you would love to have! :grinning:",
  5. "card":{  
  6.       "title":"Feedback Time",
  7.       "theme":"prompt"
  8.    },
  9.    "buttons":{  
  10.       {  
  11.          "label":"Give Feedback",
  12.          "type":"+",
  13.          "action":{  
  14.             "type":"invoke.function",
  15.             "data":{  
  16.                "name":"feedback",
  17.                "owner": " youremail@yourdomain.com "
  18.             },
  19.             "confirm":{  
  20.                "title":"Give us your valuable feedback!",
  21.                "description":"Write what you think of Connect Bot!",
  22.                "buttontext":"Submit Feedback",
  23.                "input":"Enter your feedback here"
  24.             }
  25.          }
  26.       }
  27.    }
  28. };
  29. return response;
Sample Functions Execution Code:

  1. response = Map();
  2. feedback = arguments.get("input");
  3. param = Map();
  4. param.put("text","You've got a new feedback! User:" + user.get("email") + " Feedback: " + feedback);
  5. response = invokeurl
  6. [
  7. url :"https://cliq.zoho.com/api/v2/channelsbyname/feedbackchannel/message"
  8. type :POST
  9. parameters:param.toString()
  10. connection: " your connection name "
  11. ];
  12. message = Map();
  13. message = {"text":"Thank you for your feedback! :smile: ","bot":{"name":"Connect Bot"}};
  14. info message;
  15. post_message= zoho.cliq.postToChat(chat.get("id"),message);
  16. return Map();

The below-given video demonstrates how to configure and build this custom feedback menu action and also the working

 

We hope this sample scenario threw light on how easy bot actions are to create and equally easy to use! Comments and suggestions are welcome!

Few useful links to refer: 




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