我知道如何在discord.py中发送嵌入,但我对这段代码有点困惑 任何人,请帮助我提供此命令的代码示例
@client.command()
async def wanted(ctx, user: discord.Member = None):
if user == None:
user = ctx.author
wanted = Image.open("wanted.jpg")
asset = user.avatar_url_as(size = 128)
data = BytesIO(await asset.read())
pfp = Image.open(data)
pfp = pfp.resize((257, 257))
wanted.paste(pfp, (99, 201))
wanted.save("profile.jpg")
await ctx.send(file = discord.File("profile.jpg"))
要以嵌入方式发送本地图像,请执行以下操作:
将调用程序的pfp添加到嵌入
相关问题 更多 >
编程相关推荐