Skip to content

IiroP/telegram-group-stickers

Repository files navigation

Telegram Group Sticker pack bot

This bot can be used to create collaborative sticker packs for Telegram groups. The code is still WIP, so expect there to be bugs and uncaught errors.

How to use?

This part is subject to change

  1. Group admin/owner adds the bot into the group, and sends command /createPack
    • Before this, user who wishes to create pack has to authorize the bot by sending /start to the bot with direct message (not in a group).
    • This creates the initial Sticker pack with Hello World sticker
  2. After the pack has been created, all images sent to the group with #stiku (<emojis>) as the caption are added to the pack
    • Replying to existing image/sticker with #stiku (<emojis>) also adds it to the pack

The user who initially ran the /createPack command owns the sticker pack and can also manually edit the contents

How to run the bot?

  1. Clone this repository and install dependencies with pnpm install
  2. Add .env file with following contents:
BOT_TOKEN=<insert your bot token here>
BOT_NAME=<insert your bot username here>
  1. Build the app with pnpm build
  2. Run the app with pnpm start

Testing

For generating stickers from text messages there are manual tests you can run with pnpm test:manual. This outputs sticker images to scrips/out directory (gitignored).

Docker

You can also use Docker to run the application, build with docker compose build and run with docker compose up

Requirements

If your system is not directly supported by node-canvas, check what system packages you have to install before running this app.

FAQ

  • Why are emojis not rendered? / Why are emojis rendered using wrong font?
    • node-canvas uses system emoji font to render emojis. Use Docker if you need other emoji version.

Contributing

Feel free to submit PR:s to this repo. All code should be formatted with pnpm format.

About

Telegram Bot to create collaborative sticker pack for a group

Resources

License

Stars

Watchers

Forks

Contributors