Skip to content

Commit

Permalink
Sort traits by value desc
Browse files Browse the repository at this point in the history
  • Loading branch information
chiliec committed Mar 2, 2024
1 parent c3507d1 commit 9574be4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bot/helpers/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export function randomAttributes(): TraitType[] {
"Faith",
"Bellicosity",
];
return attributes.map((attribute) => {
return { trait_type: attribute, value: randomValue() };
});
return attributes
.map((attribute) => {
return { trait_type: attribute, value: randomValue() };
})
.sort((trait1, trait2) => -(trait1.value - trait2.value));
}

0 comments on commit 9574be4

Please sign in to comment.