From 53ff03c8d1ea5b53d28c62390f04029010a9ed4a Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sat, 22 Apr 2023 12:56:46 -0600 Subject: [PATCH] Channel/Category blacklist! --- config.json.default | 7 ++++--- index.js | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.json.default b/config.json.default index 761a7d2..137fbee 100644 --- a/config.json.default +++ b/config.json.default @@ -3,9 +3,10 @@ "token": "", "errorChannel": "", "levels": { - "lvlUpEquation": "30", + "lvlUpEquation": "5 * (lvl ^ 2) + (50 * lvl) + 100", "lvlUpMessage": "{user}, you have leveled up to level {lvl}!", - "cooldownMinutes": 1 + "cooldownMinutes": 1, + "blacklist": [] } } -} \ No newline at end of file +} diff --git a/index.js b/index.js index c37235d..8a254c4 100644 --- a/index.js +++ b/index.js @@ -56,7 +56,9 @@ client.on("ready", async () => { client.on("messageCreate", async message => { if (message.author.bot) return; if (message.channel.type === "DM") return; - + if (config.discord.levels.blacklist.includes(message.channel.id)) return; + if (config.discord.levels.blacklist.includes(message.channel.parentId)) return; + // Calculate random xp let xp = Math.floor(Math.random() * 10) + 15; // If user is not in database, add them, {user: {xp = xp, lvl = 1, totalXp: xp, msgCount = 1}}