2017-01-18 1 views
1

このnode.jsスクリプトを使用してFacebookボットグリーティングテキストを更新していますが、適用すると文字の代わりに疑問符が表示されますか?アラビア語のボットグリーティングテキストが疑問符を表示していますか?

var request = require('request'); 

//========================================================= 
// Facebook setup // Run only when need updating. 
//========================================================= 

// Set FB bot greeting text 
facebookThreadAPI('./fb-greeting-text.json', 'Greeting Text'); 
// Set FB bot get started button 
facebookThreadAPI('./fb-get-started-button.json', 'Get Started Button'); 

// Calls the Facebook graph api to change various bot settings 
function facebookThreadAPI(jsonFile, cmd){ 
    // Start the request 
    request({ 
     url: 'https://graph.facebook.com/v2.6/me/thread_settings?access_token=djsaldksa', 
     method: 'POST', 
     headers: {'Content-Type': 'application/json'}, 
     form: require(jsonFile) 
    }, 
    function (error, response, body) { 
     if (!error && response.statusCode == 200) { 
      // Print out the response body 
      console.log(cmd+": Updated."); 
      console.log(body); 
     } else { 
      // TODO: Handle errors 
      console.log(cmd+": Failed. Need to handle errors."); 
      console.log(body); 
     } 
    }); 
} 

、これはあいさつファイル

{ 
    "setting_type":"greeting", 
    "greeting":{ 
    "text":"مرحبا " 
    } 
} 

での制限は、その英語でのみことがありますか?

答えて

0

幸いにも、Botのフレームワークは英語に限定されません。
必要なメッセージを送信する前に、アラビア語のパラメータをLocaleに設定するだけです。その例はhereです。

+0

しかし、私はそれを一度更新するだけで、設定全体ではありません。 jsonエンコーディングを使用する必要がありますか? –

関連する問題