K
K
Killir Vanya2292021-07-08 16:59:44
Python
Killir Vanya229, 2021-07-08 16:59:44

I want to move half a line to another line so that the text fits. How can I do this?

@bot.command()
async def drake(ctx, *, text):
    if len(text) > 45:
        return await ctx.send(embed=discord.Embed(title='Произошла ошибка!', description=f'<:error:852403860765016097> {ctx.author.mention} ваш текст больше 45 символов!!',color=error))

    text = text.split(";")
    text2 = text[0]
    text3 = text[1]
    img = Image.open("drake.jpg")
    draw = ImageDraw.Draw(img)
    drawer = ImageDraw.Draw(img)
    font = ImageFont.truetype("9303.ttf", 48)
    drawer.text((355, 150), text=text2, fill='black',font=font)
    draw.text((342, 470), text=text3,fill='black',font=font)
    img.save("drake2.jpg")
    img.paste(img, (7, 5))
    await ctx.send(file = discord.File("drake2.jpg"))


This is what the problem looks like:
60e704c11e6a1526256555.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sublime_text3, 2021-07-08
@VEYREN

Try it
Tyk
Or it's
Tyk

S
s19s93, 2021-07-08
@s19s93

'\n' tried ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question