【发布时间】:2017-06-23 08:15:56
【问题描述】:
我正在尝试在 herocard 中添加按钮列表。它在 Bot Emulator 中运行良好,但在 Messenger Channel 中不起作用。这是我的代码。
public static IList<Attachment> ToAttachmentList(this List<string> items)
{
var attachments = new List<Attachment>();
var actions = new List<CardAction>();
foreach (var item in items)
{
actions.Add(new CardAction(ActionTypes.ImBack, title: item, value: item));
}
var heroCard = new HeroCard
{
Buttons = actions
};
attachments.Add(heroCard.ToAttachment());
return attachments;
}
private async Task ShowOptions(IDialogContext context)
{
var reply = context.MakeMessage();
reply.Text = $"Here's what you can do.";
reply.AttachmentLayout = AttachmentLayoutTypes.List;
reply.Attachments = Messages.OrderingOptions.ToAttachmentList();
await context.PostAsync(reply);
}
在 Messenger 中,最后一个按钮被添加为轮播,所有按钮文本都被截断。
请帮我解决这个问题。
【问题讨论】:
标签: c# bots botframework facebook-messenger-bot