fix: Util#splitMessage when destructured (#3456)

This commit is contained in:
BannerBomb
2019-09-03 10:24:20 -04:00
committed by Crawl
parent 0a2003095d
commit 5d95a4b264

View File

@@ -56,7 +56,7 @@ class Util {
* @returns {string[]}
*/
static splitMessage(text, { maxLength = 2000, char = '\n', prepend = '', append = '' } = {}) {
text = this.resolveString(text);
text = Util.resolveString(text);
if (text.length <= maxLength) return [text];
const splitText = text.split(char);
if (splitText.some(chunk => chunk.length > maxLength)) throw new RangeError('SPLIT_MAX_LEN');