# Is there any way to create a menu based chatbot for whatsapp using RASA

**URL:** <https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271>\
**Category:** Rasa Open Source\
**Created:** [March 15, 2021, 6:11am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271 "2021-03-15T06:11:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [March 15, 2021, 6:11am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/1 "2021-03-15T06:11:36Z")

</div>

Hii @SamS, I need to create a chatbot for whatsapp using menu based approach i.e. User should only interact with the bot using numbers. Ex:

Bot:

For information regarding product select one of the following options:

1. XYZ
2. qwer
3. some\_option

User: 1

BOT: For XYZ product select from following options:

1. Option1
2. OPtion2
3. Option3

User: 2

what is the best possible way to achieve this type of usecase using RASA? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![SamS](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sams/32/3497_2.png) [@SamS](https://forum.rasa.com/u/SamS)\
**Post date:** [March 15, 2021, 9:45am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/2 "2021-03-15T09:45:48Z")

</div>

Hey @ojas, I think your use case could be covered nicely by using [buttons](https://rasa.com/docs/rasa/responses#buttons). If you don’t want the user to press buttons and really have them write only numbers, then that could be done too (in that case, you’ll have to create a [custom action](https://rasa.com/docs/rasa/custom-actions) for this). Let me know if you have more specific questions.

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [March 15, 2021, 9:50am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/3 "2021-03-15T09:50:08Z")

</div>

@SamS thanks for the reply!

Since i need to create this bot for whatsapp, so buttons can’t be used. I have multiple user stories that i have to implement on whatsapp. Since user interaction can will only be done through numbers i.e. 1,2,… . So how can intent parsing be done and implemented.

---

<div class="post-metadata">

**Author:** ![SamS](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sams/32/3497_2.png) [@SamS](https://forum.rasa.com/u/SamS)\
**Post date:** [March 15, 2021, 9:58am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/4 "2021-03-15T09:58:58Z")

</div>

I think you’ll want to group all those numerical user messages under 1 intent; possibly extracting the number itself as an entity, and then from within your custom action conditioning on the value of the extracted entity.

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [March 16, 2021, 7:29am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/5 "2021-03-16T07:29:57Z")

</div>

@SamS you mean something like this:

## intent: number\_input

- 1
- 2
- 3
- 4
- 5
- 6

---

<div class="post-metadata">

**Author:** ![SamS](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sams/32/3497_2.png) [@SamS](https://forum.rasa.com/u/SamS)\
**Post date:** [March 16, 2021, 8:53am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/6 "2021-03-16T08:53:28Z")

</div>

Yeah, for example 🙂

---

<div class="post-metadata">

**Author:** ![NikoAP77](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikoap77/32/12342_2.png) [@NikoAP77](https://forum.rasa.com/u/NikoAP77)\
**Post date:** [March 19, 2021, 4:39pm UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/7 "2021-03-19T16:39:02Z")

</div>

Hello @ojas Can you help me, how did you solve that problem

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [March 19, 2021, 5:02pm UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/8 "2021-03-19T17:02:31Z")

</div>

Hey @NikoAP77 I have been working on same. I am using a different approach to solve this. As of now i have not defined any numbered intent in my nlu.

I have introduced a flask layer between whatsapp and my rasa server.

In my flask, i have basically mapped my actual intents to the numbers. Something like this:

Intent = {‘1’ : {‘option’ : ‘option1’, ‘payload’:‘payload1’}, ‘2’ : {‘option’ : ‘option2’, ‘payload’:‘payload2’}}

So basically my flask layer sends the actual intent( i.e. payload) based on what user inputs as 1 or 2

---

<div class="post-metadata">

**Author:** ![Nik720](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik720/32/14747_2.png) [@Nik720](https://forum.rasa.com/u/Nik720)\
**Post date:** [May 4, 2021, 9:11am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/9 "2021-05-04T09:11:11Z")

</div>

@ojas I am also working on a similar kind of project, Is it working fine for you? Will it work if I start the conversation with the bot instead of passing numeric input?

---

<div class="post-metadata">

**Author:** ![Nims007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nims007/32/15057_2.png) [@Nims007](https://forum.rasa.com/u/Nims007)\
**Post date:** [June 26, 2021, 11:12am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/10 "2021-06-26T11:12:07Z")

</div>

Hey @ojas could you elaborate on this a bit?

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [July 8, 2021, 5:06pm UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/11 "2021-07-08T17:06:26Z")

</div>

Yes @Nik720, it is working fine for me. It depends on you how you start the conversation and pass the payload accordingly. Since I have already defined all my intents in rasa, I am using flask only for mapping the Number(1,2,3…) correctly to the payload. It’s like:  
1: Topic 1   
2: Topic 2

So, my flask would handle that on receiving ‘1’ as input what message or payload will it send to rasa. Something like : {sender: user1, message: topic\_1}. Here ‘topic\_1’ is the intent examples on which i have trained my model.

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [July 8, 2021, 5:07pm UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/12 "2021-07-08T17:07:20Z")

</div>

@Nims007 Please read the above reply!

---

<div class="post-metadata">

**Author:** ![Nims007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nims007/32/15057_2.png) [@Nims007](https://forum.rasa.com/u/Nims007)\
**Post date:** [July 9, 2021, 11:01am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/13 "2021-07-09T11:01:49Z")

</div>

Hi @ojas I had some questions about the flask layer, would solve a ton of problems for me personally. Is there anyway I can get in touch with you, via discord or anything else? It would be extremely helpful.

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [July 9, 2021, 11:20am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/14 "2021-07-09T11:20:26Z")

</div>

@Nims007 ya sure…on linkedin we can.

---

<div class="post-metadata">

**Author:** ![Nims007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nims007/32/15057_2.png) [@Nims007](https://forum.rasa.com/u/Nims007)\
**Post date:** [July 9, 2021, 11:28am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/15 "2021-07-09T11:28:56Z")

</div>

@ojas may I have your ID?

---

<div class="post-metadata">

**Author:** ![ojas](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@ojas](https://forum.rasa.com/u/ojas)\
**Post date:** [July 9, 2021, 11:40am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/16 "2021-07-09T11:40:16Z")

</div>

@Nims007 I have sent you connection request.

btw it’s [https://www.linkedin.com/in/ojasagrawal0808/](https://www.linkedin.com/in/ojasagrawal0808/)

---

<div class="post-metadata">

**Author:** ![Nims007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nims007/32/15057_2.png) [@Nims007](https://forum.rasa.com/u/Nims007)\
**Post date:** [July 13, 2021, 5:46am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/17 "2021-07-13T05:46:34Z")

</div>

@ojas I’ve sent you a dm on LinkedIn.

---

<div class="post-metadata">

**Author:** ![Derguene](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/derguene/32/19819_2.png) [@Derguene](https://forum.rasa.com/u/Derguene)\
**Post date:** [August 3, 2021, 8:06pm UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/18 "2021-08-03T20:06:06Z")

</div>

Hello everyone 🙂 Based on the @SamS proposal, I’ve made a small example bot that I hope will help you solve this challenge 🙌 Let me know if it was useful to you. [Link to the repository](https://github.com/DerXter/NumMenu-Bot).

---

<div class="post-metadata">

**Author:** ![NGarakapati](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ngarakapati/32/16662_2.png) [@NGarakapati](https://forum.rasa.com/u/NGarakapati)\
**Post date:** [August 23, 2021, 10:06am UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/19 "2021-08-23T10:06:14Z")

</div>

Hello Derguene

I’ve checked your project on Rasa Whatsapp bot. One thing, I didnt understand is when you type Hello!, it replied with a numbered chat and later you selected 1 and it replied about PyTorch. But it also works without saying Hello!, you can directly enter the number.

How can I get into a continuous response till that branch is closed. For example, I said Hello and I chose option1, later under that few more options will be displayed. And I’ll select that…this leads to a branch…

---

<div class="post-metadata">

**Author:** ![Derguene](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/derguene/32/19819_2.png) [@Derguene](https://forum.rasa.com/u/Derguene)\
**Post date:** [August 24, 2021, 7:03pm UTC](https://forum.rasa.com/t/is-there-any-way-to-create-a-menu-based-chatbot-for-whatsapp-using-rasa/41271/20 "2021-08-24T19:03:10Z")

</div>

Hello @NGarakapati,

You’re right, it also works when you put a number directly without going through Hello. On the other hand, it would be random since the user is not supposed to know the options available at the start of the conversation. The greeting message thus makes it possible to display the supported menu.

Ow, interesting. Do you mean taking into account submenus and where an option will depend on the submenu in question !? 🤔I have implemented single-level management. For example, if you select PyTorch (option 1), it displays a sub-menu with the version choice. From there, you can make your choice (always with numbers) and it directs you to the corresponding branch.
