Add smallAttachmentLimit config option to control the size limit of relaySmallAttachmentsAsAttachments

master
Dragory 2018-08-08 00:59:02 +03:00
parent 7e7bd03798
commit b7673b7544
1 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,7 @@ const defaultConfig = {
"accountAgeDeniedMessage": "Your Discord account is not old enough to contact modmail.", "accountAgeDeniedMessage": "Your Discord account is not old enough to contact modmail.",
"relaySmallAttachmentsAsAttachments": false, "relaySmallAttachmentsAsAttachments": false,
"smallAttachmentLimit": 1024 * 1024 * 2,
"port": 8890, "port": 8890,
"url": null, "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 // Make sure mainGuildId is internally always an array
if (! Array.isArray(finalConfig['mainGuildId'])) { if (! Array.isArray(finalConfig['mainGuildId'])) {
finalConfig['mainGuildId'] = [finalConfig['mainGuildId']]; finalConfig['mainGuildId'] = [finalConfig['mainGuildId']];