Add comments

This commit is contained in:
Stijn De Clercq 2021-01-24 13:14:44 +01:00
parent 83f28d9e21
commit 652238ce55
2 changed files with 10 additions and 3 deletions

View file

@ -24,11 +24,9 @@ class Google(commands.Cog):
if results is None:
return await ctx.send("Er ging iets fout (Response {})".format(status))
# Filter out all Nones
elements = list(filter(lambda x: x is not None, results))
if len(elements) > 10:
elements = elements[:10]
embed = discord.Embed(colour=discord.Colour.blue())
embed.set_author(name="Google Search")
@ -37,6 +35,10 @@ class Google(commands.Cog):
embed.description = "Geen resultaten gevonden."
return await ctx.reply(embed=embed, mention_author=False)
# Cut excess results out
if len(elements) > 10:
elements = elements[:10]
links = []
for index, (link, title) in enumerate(elements):