mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 17:45:03 +00:00
clean up
This commit is contained in:
parent
de7b4c5d2c
commit
c92849c1b0
1 changed files with 4 additions and 3 deletions
|
@ -58,7 +58,7 @@ export const RolesCmd = utilityCmd({
|
||||||
if (sort === "position" || sort === "order") {
|
if (sort === "position" || sort === "order") {
|
||||||
roles.sort(sorter("position", sortDir));
|
roles.sort(sorter("position", sortDir));
|
||||||
} else if (sort === "memberCount" && args.counts) {
|
} else if (sort === "memberCount" && args.counts) {
|
||||||
roles.sort((first, second) => (roleCounts!.get(second.id) ?? 0) - (roleCounts!.get(first.id) ?? 0));
|
roles.sort((first, second) => roleCounts!.get(second.id)! - roleCounts!.get(first.id)!);
|
||||||
} else if (sort === "name") {
|
} else if (sort === "name") {
|
||||||
roles.sort(sorter((r) => r.name.toLowerCase(), sortDir));
|
roles.sort(sorter((r) => r.name.toLowerCase(), sortDir));
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,15 +80,16 @@ export const RolesCmd = utilityCmd({
|
||||||
return line;
|
return line;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const codeBlock = "```py\n" + roleLines.join("\n") + "```";
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
msg.channel.send(
|
msg.channel.send(
|
||||||
trimLines(`
|
trimLines(`
|
||||||
${args.search ? "Total roles found" : "Total roles"}: ${roles.length}
|
${args.search ? "Total roles found" : "Total roles"}: ${roles.length}
|
||||||
\`\`\`py\n${roleLines.join("\n")}\`\`\`
|
${codeBlock}
|
||||||
`),
|
`),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
msg.channel.send("```py\n" + roleLines.join("\n") + "```");
|
msg.channel.send(codeBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue