-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] fixed
queue
and lyrics
crashing the bot if the text in embe…
…d was bigger than 4096. Added docs for `play`
- Loading branch information
Showing
4 changed files
with
69 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Chunks a single string into multiple multiple strings | ||
* @param {String} str | ||
* @param {Number} size | ||
* @returns Array containing the chunked strings | ||
*/ | ||
|
||
module.exports.chunkSubstr = (str, size) => { | ||
const numChunks = Math.ceil(str.length / size); | ||
const chunks = new Array(numChunks); | ||
|
||
for (let i = 0, o = 0; i < numChunks; ++i, o += size) { | ||
chunks[i] = str.substr(o, size); | ||
} | ||
|
||
return chunks; | ||
}; |