This Telegram bot stylizes any text sent by the user, and generates a sticker which is added to the user's individual sticker set.
How does it work? It converts the user's text message into an HTML string styled with various CSS elements according to the user's choice of fonts. The bot then converts the HTML string into a compressed PNG image via imgkit and PIL. The user will automatically receive the sticker generated from our bot, added to their individual sticker set.
/text
prompts the user to enter text of at most 100 characters, and allows the user to select from around 30 fonts to create a sticker./styles
displays all available styles, which are categorized into Basic, Bold, Fancy, Handwritten, Wordart, and Decorative./set_default
sets the default style./delete
deletes a previously created sticker. The user can send the sticker they want to delete or its index in the pack./help
shows the help dialogue.
- Create a Telegram bot and obtain an authentication token from @BotFather on Telegram.
- Install requirements from
requirements.txt
. - Replace your API token with the token in the
main()
function. - Run
python bot.py
.
The bot has been deployed on Telegram, you can find it @WordStickerBot.
- Python Telegram Bot - The bot API used
- imgkit - for PNG image creation
- PIL - for PNG image compression
Team Ankrypt
- Chaitanya Baranwal - CS Undergraduate, National University of Singapore (NUS) - Github: chaitanyabaranwal
- Ong Yan Chun - CS Undergraduate, National University of Singapore (NUS) - Github: yaaanch
- Liu Zechu - CS Undergraduate, National University of Singapore (NUS) - Github: LiuZechu
- Free time and lack of sleep
- This project was created during Hack&Roll 2019, a Hackathon organized by NUS Hackers.