MessageFactory.Carousel メソッド

定義

添付ファイルのコレクションを含むメッセージ アクティビティをカルーセルとして返します。

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

パラメーター

attachments
IEnumerable<Attachment>

メッセージに含める添付ファイル。

text
String

省略可能。送信するメッセージのテキスト。

ssml
String

音声対応チャネルでボットが読み上げるテキスト (省略可能)。

inputHint
String

省略可能。 は、メッセージがクライアントに配信された後、ボットがユーザー入力を受け入れるか、予期しているか、無視しているかを示します。 "acceptingInput"、"ignoringInput"、または "expectingInput" のいずれか。 既定値は "acceptingInput" です。

戻り値

添付ファイルを含むメッセージ アクティビティ。

例外

attachmentsnullです。

このコードでは、HeroCards のカルーセルを作成して送信します。

// 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);

適用対象

こちらもご覧ください