I have some code that takes a response from an API and splits it into paragraphs by regex line breaks:
choppedString = await mainResponse.split(/\n\s*\n/);
But sometimes this returns a very long paragraph, and I can't push a Discord.JS embed field thats longer than 1024 characters.
This is where I'm stuck. I can't figure out how to split a paragraph (a .split()
array elem) that is longer than 1024 characters and split it up every 5 sentences. Any help?