MessageFactory.Carousel Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Zwraca aktywność wiadomości, która zawiera zbiór załączników, jako karuzelę.
public static Microsoft.Bot.Schema.IMessageActivity Carousel(System.Collections.Generic.IEnumerable<Microsoft.Bot.Schema.Attachment> attachments, string text = default, string ssml = default, string inputHint = default);
static member Carousel : seq<Microsoft.Bot.Schema.Attachment> * string * string * string -> Microsoft.Bot.Schema.IMessageActivity
Public Shared Function Carousel (attachments As IEnumerable(Of Attachment), Optional text As String = Nothing, Optional ssml As String = Nothing, Optional inputHint As String = Nothing) As IMessageActivity
Parametry
- attachments
- IEnumerable<Attachment>
Załączniki do dołączenia do wiadomości.
- text
- String
Opcjonalnie, tekst wiadomości do wysłania.
- ssml
- String
Opcjonalnie, tekst do wypowiedzenia przez bota na kanale z mowę.
- inputHint
- String
Opcjonalnie oznacza, czy twój bot akceptuje, oczekuje lub ignoruje dane od użytkownika po przekazaniu wiadomości do klienta. Jeden z: "acceptingInput", "ignoringInput" lub "expectingInput". Domyślnie jest "acceptingInput".
Zwraca
Aktywność wiadomości zawierająca załącznik.
Wyjątki
Parametr attachments ma wartość null.
Przykłady
Ten kod tworzy i wysyła karuzelę HeroCardów.
// Create the activity and attach a set of Hero cards.
var activity = MessageFactory.Carousel(
new Attachment[]
{
new HeroCard(
title: "title1",
images: new CardImage[] { new CardImage(url: "imageUrl1.png") },
buttons: new CardAction[]
{
new CardAction(title: "button1", type: ActionTypes.ImBack, value: "item1")
})
.ToAttachment(),
new HeroCard(
title: "title2",
images: new CardImage[] { new CardImage(url: "imageUrl2.png") },
buttons: new CardAction[]
{
new CardAction(title: "button2", type: ActionTypes.ImBack, value: "item2")
})
.ToAttachment(),
new HeroCard(
title: "title3",
images: new CardImage[] { new CardImage(url: "imageUrl3.png") },
buttons: new CardAction[]
{
new CardAction(title: "button3", type: ActionTypes.ImBack, value: "item3")
})
.ToAttachment()
});
// Send the activity as a reply to the user.
await context.SendActivity(activity);