def cat(self, ctx):
"""Fetch a random cat."""
async with ctx.bot.session.get(URL_RANDOM_CAT_API) as response:
if response.status == 200:
data = await response.text()
catto = json.loads(data)
url = catto["file"]
await ctx.send(url)
else:
await ctx.send("Could not reach random.cat. :<")
评论列表
文章目录