facebook-messenjs
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "facebook-messenjs", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "API wrapper for Facebook Messenger inspired by discord.js", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -13,2 +13,6 @@ const EventEmitter = require('events'); | ||
* @param {Object} options JSON object with necessary options | ||
* @param {String} options.pageToken Page token from Facebook | ||
* @param {String} options.verifyToken Token for confirming the API to Facebook | ||
* @param {String} [options.appSecret] App secret of the app | ||
* @param {String} options.appID ID of application of chatbot from Facebook | ||
* @property {MessageManager} messageManager Property of object for storing messages | ||
@@ -18,2 +22,3 @@ * @property {ProfileManager} profileManager Property of object for storing profiles | ||
* @property {String} verifyToken Token for confirming the API to Facebook | ||
* @property {String} appSecret App secret of the app | ||
* @property {String} appID ID of application of chatbot from Facebook | ||
@@ -32,3 +37,11 @@ * @property {number} port port of API bot | ||
this.appSecret = options.appSecret; | ||
this.validation = makeDefault(options.validation, true); | ||
if (options.validation != null) { | ||
if ((options.validation) && (!options.appSecret)) { | ||
throw new Error("Validation needs app secret"); | ||
} else { | ||
this.validation = options.validation; | ||
} | ||
} else { | ||
this.validation = options.appSecret != null; | ||
} | ||
this.path = makeDefault(options.path, "/"); | ||
@@ -35,0 +48,0 @@ if ("appID" in options) { |
65613
1568