cog_utils.py 文件源码

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

项目:Godavaru 作者: Godavaru 项目源码 文件源码
def cat(self, ctx):
        """Get a random cat image!

        **Usage:** `g_cat`

        **Permission:** User"""
        colours = [0x1abc9c, 0x11806a, 0x2ecc71, 0x1f8b4c, 0x3498db, 0x206694, 0x9b59b6, 0x71368a, 0xe91e63, 0xad1457, 0xf1c40f, 0xc27c0e, 0xa84300, 0xe74c3c, 0x992d22, 0x95a5a6, 0x607d8b, 0x979c9f, 0x546e7a]
        col = int(random.random() * len(colours))
        content = [";w; Don't be sad, here's a cat!", "You seem lonely, {0.mention}. Here, have a cat".format(ctx.message.author), "Meeeooowwww!", "Awww, so cute! Look at the kitty!!1!", "Woof... wait wrong animal."]
        con = int(random.random() * len(content))
        r = requests.get('http://random.cat/meow')
        js = r.json()
        em = discord.Embed(color=colours[col])
        em.set_image(url=js['file'])
        await ctx.send(content=content[con], embed=em)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号