diff --git a/.gitignore b/.gitignore index 810c4c0..4816fd8 100644 --- a/.gitignore +++ b/.gitignore @@ -130,6 +130,7 @@ dist .pnp.* # Specific +*.env *.txt props/* package-lock.json diff --git a/package.json b/package.json index ec20d6b..875c635 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { + "@dotenvx/dotenvx": "^1.28.0", "axios": "^1.7.9", "child_process": "^1.0.2", "commander": "^12.1.0", diff --git a/src/bot.js b/src/bot.js index 1f07377..cc17137 100644 --- a/src/bot.js +++ b/src/bot.js @@ -3,10 +3,11 @@ const path = require('path'); const fs = require('fs'); const Config = require('./props/config.json'); const { isOnSpamWatch } = require('./plugins/lib-spamwatch/spamwatch.js'); +require('@dotenvx/dotenvx').config({ path: "config.env" }); require('./plugins/ytdlp-wrapper.js'); // require('./plugins/termlogger.js'); -const bot = new Telegraf(Config.botToken); +const bot = new Telegraf(process.env.botToken); const MAX_RETRIES = 5; let restartCount = 0; diff --git a/src/commands/lastfm.js b/src/commands/lastfm.js index 57b3811..22338af 100644 --- a/src/commands/lastfm.js +++ b/src/commands/lastfm.js @@ -8,7 +8,7 @@ const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(is const scrobbler_url = 'http://ws.audioscrobbler.com/2.0/'; const api_key = Config.lastKey; -const dbFile = 'props/lastfm.json'; +const dbFile = 'src/props/lastfm.json'; let users = {}; function loadUsers() {