3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 17:45:03 +00:00
This commit is contained in:
almeidx 2021-09-25 15:38:41 +01:00
parent de7b4c5d2c
commit c92849c1b0
No known key found for this signature in database
GPG key ID: 01C5E03866747F46

View file

@ -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);
} }
} }
}, },