incoming/type_cast.js
function typeCast(payload, callback)
{
  var type = find(types, function(t){ return (t in payload); });

  if (type)
  {
    payload.type = normalize(type);
  }

  callback(null, payload);
}
function typeCast(payload, callback)
{
  var type = find(types, function(t){ return (t in payload); });

  if (type)
  {
    payload.type = normalize(type);
  }

  callback(null, payload);
}
function typeCast ( payload , callback ) { var type = find ( types , function ( t ) { return ( t in payload ) ; } ) ; if ( type ) { payload . type = normalize ( type ) ; } callback ( null , payload ) ; }
Casts message type based on the present fields from the list

@this  Fbbot#
@param {object} payload - message object
@param {function} callback - invoked after type casting is done
Casts message type based on the present fields from the list