2
votes

Faced with a problem when using the Microsoft Bot Framework. I develop a bot that will run on Skype. I need create a hero card with two buttons (Yes/No), and send it to the user. I have to say, that use Microsoft Bot Framework API and Python (but language doesn't matter, I think). Use type - 'imBack' and value - string. When press the button, the message will appear in chat, with the value. This is bad for me. I want to hide a message from the user in this case is that it only received my skype bot. According to the documentation can be done. But I is not working for me.

Sending context with actions

It can be useful to send context back to your bot (e.g. a request ID) without showing this information to the user in a message. To do this you can append hidden XML to the visible string shown to the user, which is only seen by your bot.

Visible message <context hiddenId='10'/>

It is written in the documentation. I would be very grateful for the help.

2

2 Answers

2
votes

You'll want to use postBack not imBack if you want to hide the message from the end user:

The differences between postBack() and imBack() actions is subtle. The intention is that imBack() will show the message being sent to the bot in the users feed where postBack() will hide the sent message from the user. Not all channels (like Skype) currently support postBack() so those channels will simply fall back to using imBack(). This generally won’t change how your bot behaves but it does mean that if you’re including data like an order id in your postBack() it may be visible on certain channels when you didn’t expect it to be.

0
votes

Just a tip that would have saved me some time. As of today, postBack is supported on skype. There is a difference in the behavior compared to the emulator though.

In the emulator, the object put in the Value property of the card action buttons will come in the message.Value property. In the Skype case, the object will come as a string in the message.Text property.

Although this doesn't help differentiate between whether the user clicks a button or writes some text (as opposed to what happens in the emulator) this is still better than writing hidden xml directly, imo.