Python discord.py枕列meme命令文本重叠

Python discord.py枕列meme命令文本重叠,python,discord,python-imaging-library,Python,Discord,Python Imaging Library,因此,每当我尝试执行此命令时,它都会成功运行,但文本会覆盖在上面,而不是将空的train meme模板粘贴在上面 @client.command() async def trainmeme(ctx, *, text): text = text.split(",") text2 = text[0] text3 = text[1] img = Image.open("train.jpg") draw = ImageDraw.Draw(img

因此,每当我尝试执行此命令时,它都会成功运行,但文本会覆盖在上面,而不是将空的train meme模板粘贴在上面

@client.command()
async def trainmeme(ctx, *, text):
  text = text.split(",")
  text2 = text[0]
  text3 = text[1]
  img = Image.open("train.jpg")
  draw = ImageDraw.Draw(img)
  drawer = ImageDraw.Draw(img)
  font = ImageFont.truetype("Arimo.ttf", 50)
  drawer.text((197, 165), text=text2, font=font)
  draw.text((87, 531), text=text3, font=font)
  img.save("train.jpg")
  img.paste(img, (7, 5))
  await ctx.send(file = discord.File("train.jpg"))
下面是我多次尝试执行该命令时发生的情况的图片
这是因为您使用的是覆盖原始图像文件的
img.save(“train.jpg”)