From fe96b66c2df7ed9c6bee5395f1f5f31e7c7caeb6 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 6 Oct 2023 11:36:52 +0200 Subject: [PATCH] Update SplitLargeMessages.plugin.js --- .../SplitLargeMessages.plugin.js | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js b/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js index 28cdfaed57..04cab7e973 100644 --- a/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js +++ b/Plugins/SplitLargeMessages/SplitLargeMessages.plugin.js @@ -2,7 +2,7 @@ * @name SplitLargeMessages * @author DevilBro * @authorId 278543574059057154 - * @version 1.8.0 + * @version 1.8.1 * @description Allows you to enter larger Messages, which will automatically split into several smaller Messages * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -56,7 +56,7 @@ module.exports = (_ => { return template.content.firstElementChild; } } : (([Plugin, BDFDB]) => { - const messageDelay = 1000; //changing at own risk, might result in bans or mutes + const messageDelay = 2000; //changing at own risk, might result in bans or mutes let maxMessageLength = 2000; return class SplitLargeMessages extends Plugin { @@ -67,7 +67,7 @@ module.exports = (_ => { }, amounts: { splitCounter: {value: 0, description: "Messages will be split after roughly X Characters"}, - maxPages: { value: 0, description: 'Maximum number of split pages', note: "(0 for unlimited) Pages beyond this count will be discarded" } + maxPages: {value: 0, description: "Maximum number of split pages", note: "(0 for unlimited) Pages beyond this count will be discarded"} } }; @@ -132,21 +132,19 @@ module.exports = (_ => { value: this.settings.amounts.splitCounter < 1000 || this.settings.amounts.splitCounter > maxMessageLength ? maxMessageLength : this.settings.amounts.splitCounter })); - settingsItems.push( - BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { - type: 'TextInput', - childProps: { - type: 'number' - }, - plugin: this, - keys: ['amounts', 'maxPages'], - label: this.defaults.amounts.maxPages.description, - note: this.defaults.amounts.maxPages.note, - min: 0, - max: 20, - value: this.settings.amounts.splitCounter - }) - ); + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "TextInput", + childProps: { + type: "number" + }, + plugin: this, + keys: ["amounts", "maxPages"], + label: this.defaults.amounts.maxPages.description, + note: this.defaults.amounts.maxPages.note, + min: 0, + max: 20, + value: this.settings.amounts.splitCounter + })); return settingsItems; } @@ -196,7 +194,7 @@ module.exports = (_ => { } processChannelTextAreaEditor (e) { - if (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) e.instance.props.uploadPromptCharacterCount = 999999999999999; + if (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) e.instance.props.uploadPromptCharacterCount = 100000; } isSlowDowned (channel) { @@ -206,7 +204,7 @@ module.exports = (_ => { formatText (text) { const separator = !this.settings.general.byNewlines ? "\n" : " "; const splitMessageLength = this.settings.amounts.splitCounter < 1000 || this.settings.amounts.splitCounter > maxMessageLength ? maxMessageLength : this.settings.amounts.splitCounter; - const maxPages = this.settings.amounts.maxPages || Infinity; + const maxPages = this.settings.amounts.maxPages || Infinity; text = text.replace(/\t/g, " "); let longWords = text.match(new RegExp(`[^${separator.replace("\n", "\\n")}]{${splitMessageLength * (19/20)},}`, "gm"));