diff options
Diffstat (limited to 'node_modules/discord.js/src/util/SplitMessage.js')
| -rw-r--r-- | node_modules/discord.js/src/util/SplitMessage.js | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/node_modules/discord.js/src/util/SplitMessage.js b/node_modules/discord.js/src/util/SplitMessage.js deleted file mode 100644 index 3833f00..0000000 --- a/node_modules/discord.js/src/util/SplitMessage.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = function splitMessage(text, { maxLength = 1950, char = '\n', prepend = '', append = '' } = {}) { - if (text.length <= maxLength) return text; - const splitText = text.split(char); - if (splitText.length === 1) throw new Error('Message exceeds the max length and contains no split characters.'); - const messages = ['']; - let msg = 0; - for (let i = 0; i < splitText.length; i++) { - if (messages[msg].length + splitText[i].length + 1 > maxLength) { - messages[msg] += append; - messages.push(prepend); - msg++; - } - messages[msg] += (messages[msg].length > 0 && messages[msg] !== prepend ? char : '') + splitText[i]; - } - return messages; -}; |
