2017-01-09 8 views
0

botbuilderを使用してオーディオ添付ファイルを送信できません。私はボブビルダーの最新バージョンです。以下は私が使用しているコードのスニペットです。私はすべての異なるオプションを試しましたが、何も動いていません。誰かがなぜこのことが起きているのか、どうか光を当てることができますか?ボットを介してFB Messengerにオーディオ添付ファイルを送信できません

var msg = new builder.Message(session). 
sourceEvent( 
{facebook: { attachment: 
{ type: "audio", payload: 
{ url:"https://petersapparel.com/bin/clip.mp3" } } } }); 
session.send(msg); 

私は、次のエラー

Error: Request to 'https://facebook.botframework.com/v3/conversations/1106358962795256-204426340019460/activities/38b93pDlg4a' failed: [400] Bad Request at Request._callback (/workspace/FranceSayBot/node_modules/botbuilder/lib/bots/ChatConnector.js:413:46) at Request.self.callback (/workspace/FranceSayBot/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/workspace/FranceSayBot/node_modules/request/request.js:1081:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (/workspace/FranceSayBot/node_modules/request/request.js:1001:12) at IncomingMessage.g (events.js:292:16) at emitNone (events.js:91:20) 

答えて

0

にsourceEventのを使用する必要が供給しないのです。添付ファイルとして送信:

// Create and send attachment 
var attachment = { 
    contentUrl: 'https://petersapparel.com/bin/clip.mp3', 
    contentType: 'audio/mpeg', 
    name: 'My video clip' 
}; 

var msg = new builder.Message(session) 
    .addAttachment(attachment); 

session.send(msg); 
関連する問題