Skip to content
Tulir Asokan edited this page Mar 25, 2025 · 5 revisions

In addition to the sticker picker widget itself, this project includes some utility scripts you can use to import and create sticker packs.

To get started, install the dependencies for using the commands:

  1. Make sure you have Python 3.6 or higher.
  2. Clone the repo (git clone https://github.com/maunium/stickerpicker.git)
  3. (Optional) Set up a virtual environment.
    1. Create with virtualenv -p python3 .venv
    2. Activate with source .venv/bin/activate
  4. Install the utility commands and their dependencies with pip install .

Notes about Windows

If pip doesn't work directly, try py -3 -m pip. Then use py -3 -m sticker.import and py -3 -m sticker.pack instead of sticker-import and sticker-pack respectively.

Importing packs from Telegram

To import packs from Telegram, simply run sticker-import <pack urls...> with one or more t.me/addstickers/... URLs.

If you want to list the URLs of all your saved packs, use sticker-import --list. This requires logging in with your account instead of a bot token.

Notes:

  • On the first run, it'll prompt you to log in to Matrix and Telegram.
  • The Matrix URL and access token are stored in config.json by default.
  • The Telethon session data is stored in sticker-import.session by default.
  • By default, the pack data will be written to web/packs/.
  • You can pass as many pack URLs as you want.
  • You can re-run the command with the same URLs to update packs.

Creating your own packs

  1. Create a directory with your sticker images.
    • The file name (excluding extension) will be used as the caption.
    • The directory name will be used as the pack name/ID.
    • If you want the stickers to appear in a specific order, prefix them with number-, e.g. 01-Cat.png. The number and dash won't be included in the caption.
  2. Run sticker-pack <pack directory>.
    • If you want to override the pack displayname, pass --title <custom title>.
    • Pass --add-to-index web/packs/ if you want to automatically add the generated pack to your sticker picker.

Updating old packs for authenticated media

As of March 2025, maunium-stickerpicker works around Matrix's authenticated media requirements by hosting thumbnails of stickers next to the sticker pack metadata. To update old packs, you can run sticker-download-thumbnails path/to/pack.json, which will download all the media using your access token and store thumbnails in the thumbnails directory next to the pack JSON. The thumbnails should then be served along with the JSON files (if using GitHub pages, just commit the images).