Closed baruchiro closed 5 years ago
@baruchiro Can you please share a screenshot of the query you have?
Sure. I remember this from V4.3, but I can't find the code right now.
I used "very very" because a one "very" is still a card.
It need a more research. I see it shown differently in Facebook and Telegram
Can you give us the JSON for the message you are sending?
JSON for the short message:
{
"attachments": [],
"channelId": "emulator",
"conversation": {
"id": "3e91a080-7a59-11e9-b27e-b7f2dc2a2f8f|livechat"
},
"entities": [],
"from": {
"id": "2",
"name": "Bot",
"role": "bot"
},
"id": "4279fe40-7a59-11e9-99a0-d9c48d8a8fbc",
"inputHint": "acceptingInput",
"localTimestamp": "2019-05-19T20:12:19+03:00",
"locale": "",
"recipient": {
"id": "d1ff7fc6-7de6-4208-bed8-0dd025aaaa26",
"role": "user"
},
"replyToId": "4240ece0-7a59-11e9-99a0-d9c48d8a8fbc",
"serviceUrl": "https://a943a825.ngrok.io",
"suggestedActions": {
"actions": [
{
"title": "short title",
"type": "imBack",
"value": "recommendations"
}
]
},
"text": "Hi, select what you want",
"timestamp": "2019-05-19T17:12:19.748Z",
"type": "message"
}
JSON for the long title:
{
"attachments": [],
"channelId": "emulator",
"conversation": {
"id": "9476c340-7a59-11e9-b916-434698c80b5d|livechat"
},
"entities": [],
"from": {
"id": "2",
"name": "Bot",
"role": "bot"
},
"id": "9a384dd0-7a59-11e9-a6cb-c56ac337ce96",
"inputHint": "acceptingInput",
"localTimestamp": "2019-05-19T20:14:46+03:00",
"locale": "",
"recipient": {
"id": "d1ff7fc6-7de6-4208-bed8-0dd025aaaa26",
"role": "user"
},
"replyToId": "99fea030-7a59-11e9-a6cb-c56ac337ce96",
"serviceUrl": "https://8b80b63c.ngrok.io",
"text": "Hi, select what you want\n\n 1. A very very long title",
"timestamp": "2019-05-19T17:14:46.956Z",
"type": "message"
}
And this is how I create the PromptOptions
dialog:
internal PromptOptions CreateChoicesPromptOptions(string text, IDictionary<string, string> keyToTitle)
{
return new PromptOptions
{
Prompt = MessageFactory.Text(text),
Choices = keyToTitle.Select(v =>
new Choice(v.Key)
{
Action = new CardAction(ActionTypes.ImBack, v.Value, value: v.Key)
})
.ToList()
};
}
@baruchiro Suggested actions is not supported in Microsoft Teams. Could you please try using Cards and buttons?
CardAction
.I'm confused about your question. Is your question about how messages are rendered in the bot emulator? The documentation in this repository is for Microsoft Teams specifically. If you want to ask questions about the bot emulator, I'd suggest here: https://github.com/Microsoft/BotFramework-Emulator/issues
Oh sorry!
I didn't notice that this was a Microsoft Teams documentation, I thought I was in the BotFramework documentation.
Anyway, thanks for the help, I think you helped me understand that the question focuses on promptOption
with ActionCards
.
I see that when the title is a certain length, the cards cease to be buttons, and they are displayed as a numbered list within the message itself.
What sets it up?
And why?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.