1
votes

I'm trying to make a top 10 leaderboard for my server. Since there seems to be a limit on how many fields you can add and send in one embed, I divided the scoreboard. However, my program only seems to send one embed properly as seen in the following image.(the if statement was False in this image)

There is no error message in the console.

embed = discord.Embed(title = "**Leaderboard**", description = "Top 5")
    embed.set_footer(icon_url = bot.user.avatar_url)

    embed.add_field(name = "Users", value = f"{user1}", inline = True) 
    embed.add_field(name = "Beans", value = f"{bean1}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user2}", inline = True) 
    embed.add_field(name = "\u200b", value = f"{bean2}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user3}", inline = True) 
    embed.add_field(name = "\u200b", value = f"{bean3}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user4}", inline = True)
    embed.add_field(name = "\u200b", value = f"{bean4}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user5}", inline = True) 
    embed.add_field(name = "\u200b", value = f"{bean5}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)

    await ctx.send(embed = embed)

    embed2 = discord.Embed(title = "**Leaderboard**", description = "Top 10")
    embed.set_footer(icon_url = bot.user.avatar_url)

    embed.add_field(name = "Users", value = f"{user6}", inline = True)
    embed.add_field(name = "Beans", value = f"{bean6}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user7}", inline = True) 
    embed.add_field(name = "\u200b", value = f"{bean7}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user8}", inline = True)
    embed.add_field(name = "\u200b", value = f"{user8}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user9}", inline = True) 
    embed.add_field(name = "\u200b", value = f"{bean9}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)
    embed.add_field(name = "\u200b", value = f"{user10}", inline = True) 
    embed.add_field(name = "\u200b", value = f"{bean10}", inline = True)
    embed.add_field(name = "\u200b", value = "\u200b", inline = False)

    time.sleep(1)
    await ctx.send(embed = embed2)

    if leaderid not in {user001,user002,user003,user004,user005,user006,user007,user008,user009,user010}:
        embed3 = discord.Embed(title = "**Leaderboard**", description = "Your ranking")
        embed.set_footer(icon_url = bot.user.avatar_url)

        embed.add_field(name = "\u200b", value = f"{user00}", inline = True)
        embed.add_field(name = "\u200b", value = f"{bean00}", inline = True)
        embed.add_field(name = "\u200b", value = "\u200b", inline = False)

        time.sleep(1)
        await ctx.send(embed = embed3)
1

1 Answers

0
votes

You create and send embed2, but only ever modify embed. You need to modify embed2 instead

embed2 = discord.Embed(title = "**Leaderboard**", description = "Top 10")
embed2.set_footer(icon_url = bot.user.avatar_url)

embed2.add_field(name = "Users", value = f"{user6}", inline = True)
embed2.add_field(name = "Beans", value = f"{bean6}", inline = True)
...