# Buttons in Microsoft Bot Framework vs REST channels

**URL:** https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938
**Category:** Rasa Open Source
**Created:** [August 16, 2021, 4:30pm UTC](https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938 "2021-08-16T16:30:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![peterw](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@peterw](https://forum.rasa.com/u/peterw)
#### Post date: [August 16, 2021, 4:30pm UTC](https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938/1 "2021-08-16T16:30:29Z")

</div>

Hi,

As far as I know, the correct format for buttons is

```auto
{
  "title": "I don't recognise it.",
  "payload": "/affirm"
}

```

However, these buttons don’t show up at all when enabling the botframework channel and testing the bot in Microsoft’s Bot Framework Emulator. For that I have to change the format to

```auto
{
    "type": "messageBack",
    "title": "I don't recognise it.",
    "displayText": "Optional user message to be shown when clicked",
    "text": "/affirm",
}

```

But now the buttons don’t work anymore in the REST channel (I am using [GitHub - scalableminds/chatroom: React-based Chatroom Component for Rasa Stack](https://github.com/scalableminds/chatroom) as front end.)

I can use a combination of fields so that the buttons work in both channels:

```auto
{
    "type": "messageBack",
    "title": "I don't recognise it.",
    "displayText": "Optional user message to be shown when clicked",
    "text": "/affirm",
    "payload": "/affirm",
}

```

But this of course only works because both clients ignore unknown fields.

What is the recommended practice for buttons across channels? Do I have to write my button code specifically for the channel I am planning to use?

---

<div class="post-metadata">

### Author: ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)
#### Post date: [August 16, 2021, 4:42pm UTC](https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938/2 "2021-08-16T16:42:57Z")

</div>

Hello!

In `domain.yml`, you can set [Channel-Specific Response Variations](https://rasa.com/docs/rasa/responses/#channel-specific-response-variations).

Read more: [Conditional Response Variations: Technical Blog](https://blog.rasa.com/conditional-response-variations/)

---

<div class="post-metadata">

### Author: ![peterw](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@peterw](https://forum.rasa.com/u/peterw)
#### Post date: [August 17, 2021, 4:38pm UTC](https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938/3 "2021-08-17T16:38:50Z")

</div>

Thanks Chris, much appreciated.

I suppose for custom actions I look at `tracker.get_latest_input_channel()` and then produce a custom object?

Supporting more than one channel leads to quite a bit of duplication in domain.yml, for example:

```auto
responses:
  utter_spoken_to_retailer:
  - text: Have you already been to the retailer to request a refund?
    quick_replies:
      - title: Yes
        payload: /affirm
      - title: No
        payload: /deny
  - channel: botframework
    text: Have you already been to the retailer to request a refund?
    quick_replies:
      - title: Yes
        type: messageBack
        text: /affirm
      - title: No
        type: messageBack
        text: /deny

```

Any recommendations how to simplify that? We could add some pre-processing to domain.yml but I’d rather not complicate matters unnecessarily.

Related: Looking at the naming of the `get_latest_input_channel()` method I wonder if it is possible to have cross-channel conversations? And if so, will buttons rendered to display in one channel not display when continuing the conversation on another channel?

Thanks

---

<div class="post-metadata">

### Author: ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)
#### Post date: [August 17, 2021, 5:31pm UTC](https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938/4 "2021-08-17T17:31:33Z")

</div>

> [@peterw](#):
>
> I suppose for custom actions I look at `tracker.get_latest_input_channel()` and then produce a custom object?

Yup!

> [@peterw](#):
>
> Any recommendations how to simplify that?

To be honest I don’t know if there’s a better way to write that in the domain.

What I’d do if the utterances were very prone to changes is converting them all to Custom Actions. This way I’d only change the variables parts inside a `switch` statement on `tracker.get_latest_input_channel()`.

Again, not sure if that’s the best way 🙂

> [@peterw](#):
>
> I wonder if it is possible to have cross-channel conversations?

I think yes! `sender` ID will have to be the same in the different channels.

> [@peterw](#):
>
> Will buttons rendered to display in one channel not display when continuing the conversation on another channel?

In your case, the default channel (REST) and Bot Framework are not compatible, so no, you cannot display the same buttons on both, unless your original idea works.

But if you build your own applications, let’s say a web and a mobile app, you can set yourself which fields they understand and thus buttons will display on both using the same format.

---

<div class="post-metadata">

### Author: ![peterw](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@peterw](https://forum.rasa.com/u/peterw)
#### Post date: [September 28, 2021, 4:13pm UTC](https://forum.rasa.com/t/buttons-in-microsoft-bot-framework-vs-rest-channels/46938/5 "2021-09-28T16:13:55Z")

</div>

Thanks Chris.

I somehow assumed that Rasa uses some sort of neutral internal format for conversation history and then magically produces markup for all the different channels. Alas, no. We had been using REST for development and Bot Framework for production but now changed to a single channel.
