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)
评论列表
文章目录