Skip to content

Commit

Permalink
fix(Util): splitMessage not working with array (#6008)
Browse files Browse the repository at this point in the history
Co-authored-by: muchnameless <12682826+muchnameless@users.noreply.github.com>
  • Loading branch information
DTrombett and muchnameless committed Jul 3, 2021
1 parent 2446ff5 commit bd25ff5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/Util.js
Expand Up @@ -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 {
Expand Down

0 comments on commit bd25ff5

Please sign in to comment.