From abd9d368161cbf5c4dd5df79aeeca67ba4d25900 Mon Sep 17 00:00:00 2001 From: Purpzie <25022704+Purpzie@users.noreply.github.com> Date: Sun, 21 Apr 2019 02:38:09 -0500 Subject: [PATCH] feat(Util): resolve text parameter of splitMessage to a string (#3212) --- src/util/Util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/Util.js b/src/util/Util.js index 700c519bc291..828569490582 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -51,11 +51,12 @@ class Util { /** * Splits a string into multiple chunks at a designated character that do not exceed a specific length. - * @param {string} text Content to split + * @param {StringResolvable} text Content to split * @param {SplitOptions} [options] Options controlling the behavior of the split * @returns {string|string[]} */ static splitMessage(text, { maxLength = 2000, char = '\n', prepend = '', append = '' } = {}) { + text = this.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');