cyperdark / osu-api-extended

Package for advanced work with "osu" api
MIT License
49 stars 15 forks source link

add a feauture to get what placement a score is in a user's top plays. #13

Closed yorunoken closed 1 year ago

yorunoken commented 1 year ago

it would be like

        const score = await v2.user.scores.category(user.id, "best", {
          include_fails: "0",
          mode: ModeOsu,
          limit: "100",
          offset: "0",
        });
        console.log(score[0].placement) // returns 1 (as in 1st top play)
        console.log(score[9].placement) // returns 10 (as in 10th top play)

this would be useful for recent best scores, or if you're doing a compare command it would show you what place that score is in your top plays

konotorii commented 1 year ago
  1. Try using .sort()
  2. this would be useful for recent best scores, or if you're doing a compare command it would show you what place that score is in your top plays can just be done by yourself without having it in a library.
yorunoken commented 1 year ago

I did do it by myself but I thought it'd be better to just have it in the lib

cyperdark commented 1 year ago

added npm i osu-api-extended@2.5.21