@dongdev/fca-unofficial 3.0.21 → 3.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -179,3 +179,6 @@ Too lazy to write changelog, sorry! (will write changelog in the next release, t
179
179
 
180
180
  ## v3.0.20 - 2025-12-31
181
181
  - Hotfix / auto bump
182
+
183
+ ## v3.0.21 - 2025-12-31
184
+ - Hotfix / auto bump
@@ -1005,7 +1005,21 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
1005
1005
  skipped++;
1006
1006
  return;
1007
1007
  }
1008
- api[key] = require(p)(defaultFuncs, api, ctxMain);
1008
+ let mod;
1009
+ try {
1010
+ mod = require(p);
1011
+ } catch (e) {
1012
+ logger(`Failed to require API module ${p}: ${e && e.message ? e.message : String(e)}`, "warn");
1013
+ skipped++;
1014
+ return;
1015
+ }
1016
+ const factory = typeof mod === "function" ? mod : (mod && typeof mod.default === "function" ? mod.default : null);
1017
+ if (!factory) {
1018
+ logger(`API module ${p} does not export a function, skipping`, "warn");
1019
+ skipped++;
1020
+ return;
1021
+ }
1022
+ api[key] = factory(defaultFuncs, api, ctxMain);
1009
1023
  loaded++;
1010
1024
  });
1011
1025
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongdev/fca-unofficial",
3
- "version": "3.0.21",
3
+ "version": "3.0.22",
4
4
  "description": "Unofficial Facebook Chat API for Node.js - Interact with Facebook Messenger programmatically",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",