3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

utility: sort !roles by name

This commit is contained in:
Dragory 2019-02-15 05:20:38 +02:00
parent 41dd33c2d9
commit 69fc5f5df5

View file

@ -96,6 +96,12 @@ export class UtilityPlugin extends ZeppelinPlugin {
roles = roles.filter(r => r.toLowerCase().includes(searchStr));
}
roles.sort((a, b) => {
if (a.toLowerCase() > b.toLowerCase()) return 1;
if (a.toLowerCase() < b.toLowerCase()) return -1;
return 0;
});
const chunks = chunkArray(roles, 20);
for (const [i, chunk] of chunks.entries()) {
if (i === 0) {