guildinfo: hate math
This commit is contained in:
parent
ee32491dc9
commit
f119de0308
1 changed files with 15 additions and 2 deletions
|
@ -372,9 +372,9 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
|||
if (features.length > 0) {
|
||||
let featuresList = "";
|
||||
let firstFeature = true;
|
||||
for (const index in features) {
|
||||
for (let index = 0; index < features.length; index++) {
|
||||
const feature = features[index];
|
||||
if (featuresList.length + feature.length + 1 > 1024 || index === features.length - 1) {
|
||||
if (featuresList.length + feature.length + 1 > 1024) {
|
||||
embed.fields.push({
|
||||
name: firstFeature ? `Features (${features.length})` : "\u200b",
|
||||
value: featuresList.trim(),
|
||||
|
@ -382,6 +382,19 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
|
|||
});
|
||||
featuresList = feature + "\n";
|
||||
if (firstFeature === true) firstFeature = false;
|
||||
if (index === features.length - 1)
|
||||
embed.fields.push({
|
||||
name: firstFeature ? `Features (${features.length})` : "\u200b",
|
||||
value: featuresList.trim(),
|
||||
inline: true,
|
||||
});
|
||||
} else if (index === features.length - 1) {
|
||||
featuresList = feature + "\n";
|
||||
embed.fields.push({
|
||||
name: firstFeature ? `Features (${features.length})` : "\u200b",
|
||||
value: featuresList.trim(),
|
||||
inline: true,
|
||||
});
|
||||
} else {
|
||||
featuresList += feature + "\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue