简体   繁体   中英

How to make SuggestedActions as list rather than carousel

I want to make my SuggestedActions as list rather than carousel. Can I change that type?

var reply = turnContext.Activity.CreateReply();

reply.SuggestedActions = new SuggestedActions()
{
    Actions = new List<CardAction>()
    {
        new CardAction() { Title = "Residential Internet Connectivity Issue", Type = ActionTypes.ImBack, Value = "Residential Internet Connectivity Issue" },
        new CardAction() { Title = "Email Issue", Type = ActionTypes.ImBack, Value = "Email Issue" },
        new CardAction() { Title = "Security/Malware issue (Norton)", Type = ActionTypes.ImBack, Value = "Security/Malware issue (Norton)" },
        new CardAction() { Title = "Static IP", Type = ActionTypes.ImBack, Value = "Static IP" },
        new CardAction() { Title = "Product and Service Inquiry", Type = ActionTypes.ImBack, Value = "Product and Service Inquiry" },
        new CardAction() { Title = "Billing Issues", Type = ActionTypes.ImBack, Value = "Billing Issues" },
        new CardAction() { Title = "Payment Arrangements", Type = ActionTypes.ImBack, Value = "Payment Arrangements" },
    },
};

I also tried the HeroCard

card.Buttons = new List<CardAction>()
{
    new CardAction() { Title = "1. Residential Internet Connectivity Issue", Type = ActionTypes.ImBack, Value = "Residential Internet Connectivity Issue" },
    new CardAction() { Title = "2. Email Issue", Type = ActionTypes.ImBack, Value = "Email Issue" },
    new CardAction() { Title = "3. Security/Malware issue (Norton)", Type = ActionTypes.ImBack, Value = "Security/Malware issue (Norton)" },
    new CardAction() { Title = "4. Static IP", Type = ActionTypes.ImBack, Value = "Static IP" },
    new CardAction() { Title = "5. Product and Service Inquiry", Type = ActionTypes.ImBack, Value = "Product and Service Inquiry" },
    new CardAction() { Title = "6. Billing Issues", Type = ActionTypes.ImBack, Value = "Billing Issues" },
    new CardAction() { Title = "7. Payment Arrangements", Type = ActionTypes.ImBack, Value = "Payment Arrangements" },
};
reply.Attachments = new List<Attachment>() { card.ToAttachment();

but the problem with herocard as attachment is it doesn't remove after the user select one of the options, unlike suggestedaction wherein it automatically remove after the user select one of the option.

Thanks!

Like with cards, the rendering of suggested actions is controlled entirely by the channel client. The formatting of suggested actions is not supported in any channel I'm aware of, but if you're using Web Chat / Direct Line you'll be able to customize the client to do whatever you want (though this can be difficult and involved).

Depending on what channel you want this feature to be supported in, you might consider making a feature request in the appropriate GitHub repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM