meta-horizonn-fca-huh
Version:
Facebook-Chat-API Protect and Deploy by Kanzu and HZI Team. Kem is redeveloped. Rename package is Meta Horizonn and package supported ChatBot Messenger. and make it lightweight package by jonell huh
17 lines (13 loc) • 600 B
JavaScript
;
const utils = require("../utils");
module.exports = function (defaultFuncs, api, ctx) {
return function addExternalModule(moduleObj) {
if (utils.getType(moduleObj) == "Object") {
for (let apiName in moduleObj) {
if (utils.getType(moduleObj[apiName]) == "Function") api[apiName] = moduleObj[apiName](defaultFuncs, api, ctx);
else throw new Error(`Item "${apiName}" in moduleObj must be a function, not ${utils.getType(moduleObj[apiName])}!`);
}
}
else throw new Error(`moduleObj must be an object, not ${utils.getType(moduleObj)}!`);
};
};