search.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:tuxbot-bot 作者: outout14 项目源码 文件源码
def search_docubuntu(self, ctx, args):
        attends = await ctx.send("_Je te cherche ça {} !_".format(ctx.message.author.mention))
        html = urllib.request.urlopen("https://doc.ubuntu-fr.org/" + args).read()
        if "avez suivi un lien" in str(html):
           await attends.edit(content=":sob: Nooooon ! Cette page n'existe pas, mais tu peux toujours la créer : https://doc.ubuntu-fr.org/"+ args)
        else:
           await attends.delete()
           embed = discord.Embed(description="Voila j'ai trouvé ! Voici la page ramenant à votre recherche, toujours aussi bien rédigée :wink: : https://doc.ubuntu-fr.org/" + args, url='http://doc.ubuntu-fr.org/')
           embed.set_author(name="DocUbuntu-Fr", url='http://doc.ubuntu-fr.org/', icon_url='http://outout.tech/tuxbot/ubuntu.png')
           embed.set_thumbnail(url='http://outout.tech/tuxbot/ubuntu.png')
           embed.set_footer(text="Merci à ceux qui ont pris le temps d'écrire cette documentation")
           await ctx.send(embed=embed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号