我正在使用这个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":"مرحبا "
}
}
是否只有英文版的限制?