2017-03-24 16 views
0

ボットフレームワークを使用してテキスト、GIF、ボタンでアニメーションカードを表示しようとしています。これは、ボットエミュレータでは完全に動作しますが、Messengerには表示されません。何か案は?メッセンジャー 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) 
エミュレータ で

enter image description here

オフかもしれないものの任意のアイデア? { "メッセージ": "(#100)のParam [要素は、これは私のコンソール

{ "エラー" のエラーだ

UPDATE 1

ご提案のために事前にありがとうございます]、[タイプ]: "OAuthException"、 "code":100、 "fbtrace_id": "CLEcx63w + 4N"}}

答えて

2

あなたは[空白でないUTF-アニメーションカードにtitleを含める必要がある場合、Messengerはすべてのカードにタイトルを含める必要があります。また、アニメーションカードはメッセンジャーで少し違った働きをします。エミュレータのような素敵なカードの中にそれらをまとめておくのではなく、.gifでメッセージを送り、タイトルとボタンのあるカードが続きます。

あなたのユースケースでは、タイトルとサブタイトルの質問のレベルを1行目で表します。このテキストは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) 
関連する問題