message: Add messenger profile greeting message
diff: @@ -36,8 +36,6 @@ function Facebookbot(configuration) {
  }
  -
  -
  // customize the bot definition, which will be used when new connections
  // spawn!
  facebook_botkit.defineBot(function (botkit, config) {
  @@ -396,7 +394,9 @@ function Facebookbot(configuration) {
  function () {
  facebook_botkit.log('** Starting webserver on port ' +
  facebook_botkit.config.port);
  - if (cb) { cb(null, facebook_botkit.webserver); }
  + if (cb) {
  + cb(null, facebook_botkit.webserver);
  + }
  });
  @@ -415,13 +415,18 @@ function Facebookbot(configuration) {
  };
  var messenger_profile_api = {
  - greeting: function(greeting) {
  + greeting: function (payload) {
  var message = {
  - 'setting_type': 'greeting',
  - 'greeting': {
  - 'text': greeting
  - }
  + "greeting": []
  };
  + if (Array.isArray(payload)) {
  + message.greeting = payload;
  + } else {
  + message.greeting.push({
  + 'locale': 'default',
  + 'text': payload
  + });
  + }
  facebook_botkit.api.messenger_profile.postAPI(message);
  },
  delete_greeting: function () {
  