fix(Util): allow empty strings in splitMessage (#6437)

This commit is contained in:
MarkusRost
2021-08-18 10:47:13 +02:00
committed by GitHub
parent 93a83c2cf7
commit d6e6244336

View File

@@ -70,7 +70,7 @@ class Util extends null {
* @returns {string[]}
*/
static splitMessage(text, { maxLength = 2000, char = '\n', prepend = '', append = '' } = {}) {
text = Util.verifyString(text, RangeError, 'MESSAGE_CONTENT_TYPE', false);
text = Util.verifyString(text);
if (text.length <= maxLength) return [text];
let splitText = [text];
if (Array.isArray(char)) {