title: How to make pillow text not get offscreen
body: <p>I made a command that adds text to an image. But the problem is that sometimes the text just goes offscreen if someone inputs a long message. How can I fix this?</p>
  <pre><code>@bot.command()
  async def Picture1(ctx,*,message=None):
  
      member = ctx.author
      if message ==None:
          await ctx.send(&quot;You have to put a message in idiot&quot;)
          return
  
      text1 = str(member)
      print(text1)
  
      # get an image
      base = Image.open(r&quot;C:\Users\User\Pictures\Picture.png&quot;).convert(&quot;RGBA&quot;)
  
      # make a blank image for the text, initialized to transparent text color
      txt = Image.new(&quot;RGBA&quot;, base.size, (255, 255, 255, 0))
  
      # get a font
      fnt = ImageFont.truetype(
          r&quot;C:\Users\User\fonts\courbi.ttf&quot;, 40)
      # get a drawing context
      d = ImageDraw.Draw(txt)
  
      # draw text, half opacity
      d.text((21, 70), &quot;'&quot; + message + &quot;'&quot;, font=fnt,
             fill=(255, 255, 255, 128))
      # draw text, full opacity
      d.text((10, 213), &quot;-&quot; + text1, font=fnt, fill=(255, 255, 255, 255))
  
      out = Image.alpha_composite(base, txt)
  
      out.save(&quot;picutre1.png&quot;, format=&quot;png&quot;)
      print(out.save)
  
      await ctx.send(file=discord.File(&quot;quote.png&quot;))
  </code></pre>