mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Add comments
This commit is contained in:
parent
83f28d9e21
commit
652238ce55
2 changed files with 10 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue