@commands.command(name='hoogle', brief='search hoogle')
async def hoogle(self, ctx, *query: str):
    'Searches Hoggle and returns first two options\n        Click title to see full search'
    url = f"https://hoogle.haskell.org?mode=json&hoogle={'+'.join(query)}&start=1&count=1"
    (result, error) = (await get_json(url))
    if error:
        (await ctx.send(error))
        return
    embed = discord.Embed(title=f"Definition of {' '.join(query)}", url=f"https://hoogle.haskell.org/?hoogle={'+'.join(query)}", color=self.bot.embed_color)
    embed.set_thumbnail(url='https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Lambda-letter-lowercase-symbol-Garamond.svg/1200px-Lambda-letter-lowercase-symbol-Garamond.svg.png')
    if (not result):
        embed.add_field(name='No results found', value='*undefined*', inline=False)
    else:
        for l in result:
            val = (('*Module:* ' + l['module']['name']) + '\n')
            val += sub('\\n{2,}', '\n\n', sub('\\n +', '\n', html2text(l['docs'])))
            embed.add_field(name=html2text(l['item']), value=val, inline=False)
        embed.set_footer(text='first option in Hoogle (Click title for more)')
    (await ctx.send(embed=embed))
Searches Hoggle and returns first two options
Click title to see full search
@commands.command(name='hoogle', brief='search hoogle')
async def hoogle(self, ctx, *query: str):
    'Searches Hoggle and returns first two options\n        Click title to see full search'
    url = f"https://hoogle.haskell.org?mode=json&hoogle={'+'.join(query)}&start=1&count=1"
    (result, error) = (await get_json(url))
    if error:
        (await ctx.send(error))
        return
    embed = discord.Embed(title=f"Definition of {' '.join(query)}", url=f"https://hoogle.haskell.org/?hoogle={'+'.join(query)}", color=self.bot.embed_color)
    embed.set_thumbnail(url='https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Lambda-letter-lowercase-symbol-Garamond.svg/1200px-Lambda-letter-lowercase-symbol-Garamond.svg.png')
    if (not result):
        embed.add_field(name='No results found', value='*undefined*', inline=False)
    else:
        for l in result:
            val = (('*Module:* ' + l['module']['name']) + '\n')
            val += sub('\\n{2,}', '\n\n', sub('\\n +', '\n', html2text(l['docs'])))
            embed.add_field(name=html2text(l['item']), value=val, inline=False)
        embed.set_footer(text='first option in Hoogle (Click title for more)')
    (await ctx.send(embed=embed))