fix(Util): splitMessage not working with array (#6008)

Co-authored-by: muchnameless <12682826+muchnameless@users.noreply.github.com>
This commit is contained in:
DTrombett
2021-07-03 14:25:43 +02:00
committed by GitHub
parent 2446ff5251
commit bd25ff5913

View File

@@ -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 {