Skip to content

Commit

Permalink
Revert "feat(Util): resolve text parameter of splitMessage to a string (
Browse files Browse the repository at this point in the history
discordjs#3212)"

This reverts commit 6e230b9.
  • Loading branch information
samsamson33 committed Feb 27, 2020
1 parent 9a5b629 commit bab9bc5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/util/Util.js
Expand Up @@ -51,12 +51,11 @@ class Util {

/**
* Splits a string into multiple chunks at a designated character that do not exceed a specific length.
* @param {StringResolvable} text Content to split
* @param {string} 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');
Expand Down

0 comments on commit bab9bc5

Please sign in to comment.