Maybe?
This commit is contained in:
parent
c495679414
commit
695a7b935f
21
index.js
21
index.js
|
@ -241,14 +241,13 @@ const generateExtensionListEmbed = async () => {
|
||||||
await (async () => {
|
await (async () => {
|
||||||
for (let key in extensionList) {
|
for (let key in extensionList) {
|
||||||
field += `\`${key}${inactiveFlag[key]}\`: ${extensionList[key]}\n`;
|
field += `\`${key}${inactiveFlag[key]}\`: ${extensionList[key]}\n`;
|
||||||
if (cound == 0) {
|
|
||||||
embeds[0].fields = [{
|
|
||||||
"name": "Extensions",
|
|
||||||
"value": field
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
if (field.length >= 1024) {
|
if (field.length >= 1024) {
|
||||||
|
// cut feilds at nearest newline and push to the embed
|
||||||
|
let lastNewline = field.lastIndexOf("\n", 1024);
|
||||||
|
embeds[count].fields = [{
|
||||||
|
"name": "Extensions",
|
||||||
|
"value": field.slice(0, lastNewline)
|
||||||
|
}];
|
||||||
embeds.push({
|
embeds.push({
|
||||||
"color": 0x00ff00,
|
"color": 0x00ff00,
|
||||||
"description": `${extensions.length} extensions\n\`* = inactive for 30 days\`\n\`** = inactive for 90 days\`\n\`- = never used\``,
|
"description": `${extensions.length} extensions\n\`* = inactive for 30 days\`\n\`** = inactive for 90 days\`\n\`- = never used\``,
|
||||||
|
@ -259,8 +258,14 @@ const generateExtensionListEmbed = async () => {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
field = "";
|
// figure out any extensions that got cut off and add them to the next embed
|
||||||
|
field = field.slice(lastNewline);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
embeds[count].fields = [{
|
||||||
|
"name": "Extensions",
|
||||||
|
"value": field
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue