2017-03-24 2 views
0

텍스트, GIF 및 버튼이있는 Bot Framework를 사용하여 애니메이션 카드를 표시하려고합니다. 그것은 봇 에뮬레이터에서 완벽하게 작동하지만 Messenger에는 나타나지 않습니다. 어떤 아이디어?AnimationCard는 Messenger에서 작동하지만 에머에서 작동하지 않습니다.

코드 enter image description here

오프가 무엇인지 어떤 아이디어 메신저 에 에뮬레이터 enter image description here

/**Send the question with the level information if available, the index and the Math expression along with a countdown timer as GIF attachment */ 
let message = new builder.Message(session) 
    .text(level ? level + ' \n' + strings.question : strings.question, dialogData.index + 1, question.expression) 
    .addAttachment(
    new builder.AnimationCard(session) 
     .media([{ 
      profile: "image/gif", 
      url: "https://media.giphy.com/media/l3q2silev6exF53pu/200w.gif" 
     }]) 
     .buttons(buttons) 
    // .toAttachment() 
    ) 
session.send(message) 

? { "메시지": "(# 100) 파람 [요소 이 내 콘솔

{"오류 "에 오류가에서는 1

제안

업데이트를 위해 사전에 감사합니다 ] "[0] [제목] 비어 있지 않은 UTF-8로 인코딩 된 문자열이어야합니다.", "type": "OAuthException", "code": 100, "fbtrace_id": "CLEcx63w + 4N"}}

답변

2

You 애니메이션 카드에 title을 포함해야하는 경우, 메신저는 모든 카드에 제목을 포함시켜야합니다. 또한 애니메이션 카드는 메신저에서 조금 다른 방식으로 작동합니다. 즉, .gif와 함께 제목과 버튼이있는 카드를 보내고 에뮬레이터처럼 멋진 카드에 모두 넣지 마십시오.

사용 사례에서는 제목이 어떤 수준이고 부제는 무엇인지 말하는 첫 번째 줄을 사용합니다. 이 텍스트는 위에있는 대신 gif 아래에 표시됩니다. 따라서 지금 가지고있는 것과 약간 다른 레이아웃입니다.

let message = new builder.Message(session) 
    .addAttachment(
    new builder.AnimationCard(session) 
     .title(level ? level : 'Level 0') 
     .subtitle(strings.question) 
     .media([{ 
      profile: "image/gif", 
      url: "https://media.giphy.com/media/l3q2silev6exF53pu/200w.gif" 
     }]) 
     .buttons(buttons) 
    ) 
session.send(message)