【发布时间】:2021-07-11 10:37:38
【问题描述】:
我知道我可以发出如下命令:
async def cat(self, ctx):
response = requests.get('https://aws.random.cat/meow')
data = response.json()
embed = discord.Embed(
title = 'Kitty Cat ????',
description = 'Cat',
colour = discord.Colour.purple()
)
embed.set_image(url=data['file'])
embed.set_footer(text="")
await ctx.send(embed=embed)
顺便说一句,不是我的代码 但是我如何像 !image computer 一样发出搜索命令,它会从图像搜索中获取随机的计算机图像并将其发送到频道
【问题讨论】:
-
欢迎来到 Stack Overflow!人们很少只是简单地为您编写代码。我们希望看到您在代码中付出一些努力并将其显示在问题中。如果您想了解如何操作,请查看here。
-
您要么需要使用google api,例如Google-Images-Search 1.3.8,要么找到类似Unsplash Source的api
标签: python python-3.x discord discord.py bots