1
0
Fork 0
mirror of synced 2024-04-27 09:12:22 +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
data = sorted(
data[:10],
data,
key=lambda n: n["score"],
reverse=True,
)
# And convert to a string
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)