mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
fix(Util): splitMessage not working with array (#6008)
Co-authored-by: muchnameless <12682826+muchnameless@users.noreply.github.com>
This commit is contained in:
@@ -75,9 +75,9 @@ class Util extends null {
|
|||||||
while (char.length > 0 && splitText.some(elem => elem.length > maxLength)) {
|
while (char.length > 0 && splitText.some(elem => elem.length > maxLength)) {
|
||||||
const currentChar = char.shift();
|
const currentChar = char.shift();
|
||||||
if (currentChar instanceof RegExp) {
|
if (currentChar instanceof RegExp) {
|
||||||
splitText = splitText.map(chunk => chunk.match(currentChar));
|
splitText = splitText.flatMap(chunk => chunk.match(currentChar));
|
||||||
} else {
|
} else {
|
||||||
splitText = splitText.map(chunk => chunk.split(currentChar));
|
splitText = splitText.flatMap(chunk => chunk.split(currentChar));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user