mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-13 08:33:02 -04:00
fix single chunk lyrics
This commit is contained in:
parent
dc1fb53896
commit
8958f9b5f5
1 changed files with 26 additions and 18 deletions
|
@ -35,9 +35,10 @@ module.exports = {
|
||||||
search = search.response
|
search = search.response
|
||||||
|
|
||||||
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
if(search.body.status == 2) return editOrReply(context, {embeds:[createEmbed("error", context, search.body.message)]})
|
||||||
// Split lyrics into field-sizes chunks
|
|
||||||
let chunks = search.body.lyrics.split(/\[(.*?)\]/) // should give us every chunk
|
|
||||||
let fields = [];
|
let fields = [];
|
||||||
|
if(search.body.lyrics.includes('[')){
|
||||||
|
// Split lyrics into field-sizes chunks if multiple verses are present
|
||||||
|
let chunks = search.body.lyrics.split(/\[(.*?)\]/)
|
||||||
let cur = {
|
let cur = {
|
||||||
inline: false
|
inline: false
|
||||||
};
|
};
|
||||||
|
@ -57,6 +58,13 @@ module.exports = {
|
||||||
inline: false
|
inline: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else { // If we have no chunking to do, just use the entire thing
|
||||||
|
fields.push({
|
||||||
|
name: "Lyrics",
|
||||||
|
value: search.body.lyrics.substr(0,900),
|
||||||
|
inline: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(fields.length > 3){
|
if(fields.length > 3){
|
||||||
let pages = []
|
let pages = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue