mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
fix: Util#splitMessage when destructured (#3456)
This commit is contained in:
@@ -56,7 +56,7 @@ class Util {
|
|||||||
* @returns {string[]}
|
* @returns {string[]}
|
||||||
*/
|
*/
|
||||||
static splitMessage(text, { maxLength = 2000, char = '\n', prepend = '', append = '' } = {}) {
|
static splitMessage(text, { maxLength = 2000, char = '\n', prepend = '', append = '' } = {}) {
|
||||||
text = this.resolveString(text);
|
text = Util.resolveString(text);
|
||||||
if (text.length <= maxLength) return [text];
|
if (text.length <= maxLength) return [text];
|
||||||
const splitText = text.split(char);
|
const splitText = text.split(char);
|
||||||
if (splitText.some(chunk => chunk.length > maxLength)) throw new RangeError('SPLIT_MAX_LEN');
|
if (splitText.some(chunk => chunk.length > maxLength)) throw new RangeError('SPLIT_MAX_LEN');
|
||||||
|
|||||||
Reference in New Issue
Block a user