I tried a few times to get the rank(if he is the user with the most xp, or 2th most ad so on) of the player to the rankcard, but I only come to the point that I list the experience from the most to the lowest.
Can somebody help me how I can get the rank of the player?

```
    @commands.command(aliases = ["rank","lvl"])
    async def level(self, ctx, member: discord.Member = None):
        async with ctx.typing():
            user = ctx.message.author
            with open("level.json","r") as f:
                users = json.load(f)
            lvl = users[str(ctx.guild.id)][str(user.id)]["level"]
            exp = users[str(ctx.guild.id)][str(user.id)]["experience"]

            rankcard = Image.open("Zumtest.png")

            url = requests.get(user.avatar_url)
            avatar = Image.open(BytesIO(url.content))
            avatar = avatar.resize((177, 177));
            avatar.convert('RGBA')
            bigsize = (avatar.size[0] * 3, avatar.size[1] * 3)
            mask = Image.new("L", bigsize, 0)
            draw = ImageDraw.Draw(mask)
            draw.ellipse((0, 0) + bigsize, fill=255)
            mask = mask.resize(avatar.size, Image.ANTIALIAS)
            avatar.putalpha(mask)

            rankcard.paste(avatar, (100,40), avatar)

            lvltext = "Level {}".format(lvl)
            exptext = f"{exp} XP"

            draw = ImageDraw.Draw(rankcard)
            font = ImageFont.truetype("arial.ttf", 30)

            draw.text((255,60), lvltext, (0, 0, 0,), font=font)

            draw = ImageDraw.Draw(rankcard)

            draw.text((255,117), exptext, (0, 0, 0,), font=font)

        rankcard.save("profile.png")

        await ctx.send(file = discord.File("profile.png"))

```

That is the level.json

```
{"719479402953572383": {"504641949068689430": {"experience": 4, "level": 1}}}

```