From 42cb4c1c98d1962bd9e8239f2085860d632acfa8 Mon Sep 17 00:00:00 2001 From: Melvin Jones Repol Date: Mon, 15 Apr 2024 15:09:11 +0800 Subject: [PATCH] Initial Commit --- README.md | 13 ++++++++++++- index.js | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e78b344b..6bacd460 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,18 @@ Meet the lightning-fast Facebook Messenger chatbot, seamlessly managing multiple npm run eslint ./ ``` - +## Common Problems & Fixes +- Module not found + ```sh + # run + npm run setup + ``` +- Problems related to .env + ```sh + rm -rf .env + # just delete the .env + # and start again + ``` ## Contribute Code contributions are welcome! Please commit any pull requests against the master branch. Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. diff --git a/index.js b/index.js index e2361bfc..621c7e7f 100644 --- a/index.js +++ b/index.js @@ -711,7 +711,7 @@ fs.readdir(__dirname + "/data/cookies/", async function (err, files) { if (process.env.APP_STATE) { const app_state_env = JSON.parse(process.env.APP_STATE); const login_from_env = getUserIdFromAppState(app_state_env); - if (!process.env.ROOT) { + if (!process.env.ROOT && !processEnv.ROOT) { processEnv.ROOT = login_from_env; utils.log("root_account " + login_from_env); } @@ -732,7 +732,7 @@ fs.readdir(__dirname + "/data/cookies/", async function (err, files) { for (let appStates in files) { if (files[appStates].endsWith(".bin")) { let login = files[appStates].replace(".bin", ""); - if (!process.env.ROOT) { + if (!process.env.ROOT && !processEnv.ROOT) { processEnv.ROOT = login; utils.log("root_account " + login); }