From b7673b7544e6dedeecdc139f6e917a6c2a20623e Mon Sep 17 00:00:00 2001 From: Dragory Date: Wed, 8 Aug 2018 00:59:02 +0300 Subject: [PATCH] Add smallAttachmentLimit config option to control the size limit of relaySmallAttachmentsAsAttachments --- src/config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.js b/src/config.js index 856a514..4d7cd86 100644 --- a/src/config.js +++ b/src/config.js @@ -69,6 +69,7 @@ const defaultConfig = { "accountAgeDeniedMessage": "Your Discord account is not old enough to contact modmail.", "relaySmallAttachmentsAsAttachments": false, + "smallAttachmentLimit": 1024 * 1024 * 2, "port": 8890, "url": null, @@ -117,6 +118,11 @@ for (const opt of required) { } } +if (finalConfig.smallAttachmentLimit > 1024 * 1024 * 8) { + finalConfig.smallAttachmentLimit = 1024 * 1024 * 8; + console.log('[WARN] smallAttachmentLimit capped at 8MB'); +} + // Make sure mainGuildId is internally always an array if (! Array.isArray(finalConfig['mainGuildId'])) { finalConfig['mainGuildId'] = [finalConfig['mainGuildId']];