From bd25ff59133ba31713647d3e6a5ef66abc4d54fb Mon Sep 17 00:00:00 2001 From: DTrombett <73136330+DTrombett@users.noreply.github.com> Date: Sat, 3 Jul 2021 14:25:43 +0200 Subject: [PATCH] fix(Util): splitMessage not working with array (#6008) Co-authored-by: muchnameless <12682826+muchnameless@users.noreply.github.com> --- src/util/Util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/Util.js b/src/util/Util.js index b6cc50e30c56..e891182daa92 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -75,9 +75,9 @@ class Util extends null { while (char.length > 0 && splitText.some(elem => elem.length > maxLength)) { const currentChar = char.shift(); if (currentChar instanceof RegExp) { - splitText = splitText.map(chunk => chunk.match(currentChar)); + splitText = splitText.flatMap(chunk => chunk.match(currentChar)); } else { - splitText = splitText.map(chunk => chunk.split(currentChar)); + splitText = splitText.flatMap(chunk => chunk.split(currentChar)); } } } else {