diff --git a/src/util/Util.js b/src/util/Util.js index 7fa6d33fa..ada12fdac 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -19,7 +19,9 @@ class Util { static splitMessage(text, { maxLength = 1950, char = '\n', prepend = '', append = '' } = {}) { if (text.length <= maxLength) return text; const splitText = text.split(char); - if (splitText.length === 1) throw new Error('Message exceeds the max length and contains no split characters.'); + if (splitText.some(chunk => chunk.length > maxLength)) { + throw new Error('Message exceeds the max length and contains no split characters.'); + } const messages = ['']; let msg = 0; for (let i = 0; i < splitText.length; i++) {