Send a sticker with text added through pyrogram

184 views Asked by At

I've discovered @Vulcybot on telegram which allows people to add text to a furry 'sign' sticker like so... example

The user allows the submition of your own furry sticker to the bot.. However I don't want people to be able to use it.. I'd rather it just be either my user ID that can use my sticker or a secretive command only I know.

I have the sticker already made.. I'm just looking for a guide on how to make something like this?

Many thanks

  • Arlo!

I have tried a few queries on google but there seems to be absolutely nothing on the topic.

1

There are 1 answers

0
parsa poorsh On

you can add text to image with pillow module

here is one example:

from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
 
in_file = './input.png'
out_file = './output.png'
text = 'this is a text'
 
img = Image.open(in_file)
draw = ImageDraw.Draw(img)
font = ImageFont.truetype('FreeMono.ttf', 20)
draw.text((0, 0), text, (255, 255, 255), font=font)
img.save(out_file)