다음을 통해 공유


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

적용 대상

추가 정보