1
0
Fork 0
mirror of synced 2024-05-07 22:22:26 +12:00

Need to limit AFTER sorting

This commit is contained in:
Dan Hess 2021-03-31 23:37:58 -08:00
parent 847e5361ac
commit f2f26a7fdf

View file

@ -90,13 +90,13 @@ query ($name: String) {
# Filtering done, sort it # Filtering done, sort it
data = sorted( data = sorted(
data[:10], data,
key=lambda n: n["score"], key=lambda n: n["score"],
reverse=True, reverse=True,
) )
# And convert to a string # And convert to a string
data = "\n".join( data = "\n".join(
f"**Score**: {x['score']} | **Title**: {x['title']}" for x in data f"**Score**: {x['score']} | **Title**: {x['title']}" for x in data[:10]
) )
await ctx.send(data) await ctx.send(data)