From d83f40959f580fa6528344d3def9f36cdeba5303 Mon Sep 17 00:00:00 2001 From: Joram Kempf Date: Fri, 23 Sep 2022 08:25:41 +0200 Subject: [PATCH] Added env config Support --- README.md | 2 +- reactionThreads.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 243c5b9..7384bda 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Make sure you are running at least v3.3.0 of Modmail. in your config.ini file, create a new line and add ``` plugins[] = npm:MMPlugins/ReactionThreads -reactionThreads-ownerId = +reactionThreads-ownerId = (`MM_REACTION_THREADS_OWNER_ID` for .env files) extraIntents[] = guildMessageReactions ``` to your config and replace `` with your user ID. Only the person with this ID is allowed to add/remove reactions. diff --git a/reactionThreads.js b/reactionThreads.js index 10089f4..be77d58 100644 --- a/reactionThreads.js +++ b/reactionThreads.js @@ -7,7 +7,7 @@ module.exports = function ({ bot, config, commands, knex, threads }) { let refreshTimeout = null; // Check if ownerId is specified in the config, warn otherwise - const ownerId = config["reactionThreads-ownerId"]; + const ownerId = config["reactionThreads-ownerId"] ??= config["reactionThreadsOwnerId"]; if (typeof ownerId === "undefined") { console.info( '[ReactionThreads] No ownerId specified in config via "reactionThreads-ownerId", everyone (with inboxServerPermission) will be able to add new reactions!',