Import Telegram sticker packs (not just Signal) #2

Open
opened 2026-10-04 20:18:48 +00:00 by robocub · 1 comment
Owner

Why

Telegram sticker packs are what a lot of people have. Today Commet only imports Signal packs (sgnl:// and signal.art links).

What exists

  • Import dialog: commet/lib/ui/pages/settings/categories/room/emoji_packs/bulk_import_view.dart. fetchUrl() branches on the URL scheme and calls loadSignalPack(), which fills names, datas, images and the cover index. Emoji -> shortcode mapping and de-duplication (ensureNoConflictingNames) are reusable as-is.
  • Upload: MatrixImportEmoticonPackTask (already handles rate limits). Packs are standard MSC2545 image packs.
  • Proxy routes are done: GET /proxy/telegram/stickers/<set_name> returns {name, title, cover, stickers:[{id, emoji, width, height, format, url}]} and GET /proxy/telegram/media/<file_id> streams the file. The bot token never reaches the client.

Plan

Phase 1, static packs (small):

  • Accept https://t.me/addstickers/<name> and tg://addstickers?set=<name>, plus a bare set name.
  • Fetch the listing from the proxy and download each webp sticker into the existing preview grid; feed the existing upload task.
  • Animated (tgs) and video (webm) stickers: skip, and say so in the dialog ("12 of 40 stickers are animated and were skipped") instead of failing silently.
  • Custom-emoji sets (sticker_type: custom_emoji) default the pack usage to emoji rather than sticker.

Phase 2, animated packs (medium): transcode in the proxy, not the client: tgs (gzipped Lottie) via rlottie, webm via ffmpeg, both to animated WebP. mautrix-telegram's converter is a working reference. Check that animated WebP stickers render in Element, Cinny and FluffyChat before choosing the output format.

Acceptance

  • A public static pack imports with names, emoji shortcodes and a cover, and the stickers render in Element.
  • An animated pack imports its static members and reports the skipped count (phase 1), then imports fully (phase 2).

Blocked on #1 (proxy deployment).


Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker.

## Why Telegram sticker packs are what a lot of people have. Today Commet only imports Signal packs (`sgnl://` and `signal.art` links). ## What exists - Import dialog: `commet/lib/ui/pages/settings/categories/room/emoji_packs/bulk_import_view.dart`. `fetchUrl()` branches on the URL scheme and calls `loadSignalPack()`, which fills `names`, `datas`, `images` and the cover index. Emoji -> shortcode mapping and de-duplication (`ensureNoConflictingNames`) are reusable as-is. - Upload: `MatrixImportEmoticonPackTask` (already handles rate limits). Packs are standard MSC2545 image packs. - Proxy routes are done: `GET /proxy/telegram/stickers/<set_name>` returns `{name, title, cover, stickers:[{id, emoji, width, height, format, url}]}` and `GET /proxy/telegram/media/<file_id>` streams the file. The bot token never reaches the client. ## Plan **Phase 1, static packs (small):** - Accept `https://t.me/addstickers/<name>` and `tg://addstickers?set=<name>`, plus a bare set name. - Fetch the listing from the proxy and download each `webp` sticker into the existing preview grid; feed the existing upload task. - Animated (`tgs`) and video (`webm`) stickers: skip, and say so in the dialog ("12 of 40 stickers are animated and were skipped") instead of failing silently. - Custom-emoji sets (`sticker_type: custom_emoji`) default the pack usage to emoji rather than sticker. **Phase 2, animated packs (medium):** transcode in the proxy, not the client: `tgs` (gzipped Lottie) via rlottie, `webm` via ffmpeg, both to animated WebP. mautrix-telegram's converter is a working reference. Check that animated WebP stickers render in Element, Cinny and FluffyChat before choosing the output format. ## Acceptance - A public static pack imports with names, emoji shortcodes and a cover, and the stickers render in Element. - An animated pack imports its static members and reports the skipped count (phase 1), then imports fully (phase 2). Blocked on #1 (proxy deployment). --- _Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker._
Author
Owner

Progress 2026-10-04:

Proxy (phase 2) — live on proxy.nether.im (vomit-proxy bb0f8a9):

  • Animated stickers are converted to animated WebP: Lottie .tgs via rlottie, video .webm via ffmpeg, transparency preserved.
  • Defaults 256 px, at most 20 fps, quality 60. On a real pack that is ~1 s and ~430 KB per Lottie sticker; video stickers are smaller (~115 KB). Settings are environment variables.
  • Cached on disk per sticker. Repeat fetches take ~0.35 s instead of ~1.3 s.
  • Live-tested through the public URL with a Lottie pack and a video pack.

Client — branch feat/telegram-sticker-import (not merged):

  • Accepts t.me/addstickers/…, telegram.me/…, no-scheme and tg://addstickers?set=… links, plus the addemoji forms.
  • Shows load errors and skipped-sticker counts. Retries a failed download once, then leaves that sticker out instead of blocking the import.
  • 18 unit tests for link parsing.

Not done yet: custom-emoji sets should default the pack to emoji usage, but the import callback has no usage parameter yet; and the whole flow needs a manual test in the built app.

Progress 2026-10-04: **Proxy (phase 2) — live on proxy.nether.im** ([vomit-proxy bb0f8a9](https://nether.codes/robocub/vomit-proxy/commit/bb0f8a9)): - Animated stickers are converted to animated WebP: Lottie `.tgs` via rlottie, video `.webm` via ffmpeg, transparency preserved. - Defaults 256 px, at most 20 fps, quality 60. On a real pack that is ~1 s and ~430 KB per Lottie sticker; video stickers are smaller (~115 KB). Settings are environment variables. - Cached on disk per sticker. Repeat fetches take ~0.35 s instead of ~1.3 s. - Live-tested through the public URL with a Lottie pack and a video pack. **Client — branch `feat/telegram-sticker-import`** (not merged): - Accepts `t.me/addstickers/…`, `telegram.me/…`, no-scheme and `tg://addstickers?set=…` links, plus the `addemoji` forms. - Shows load errors and skipped-sticker counts. Retries a failed download once, then leaves that sticker out instead of blocking the import. - 18 unit tests for link parsing. Not done yet: custom-emoji sets should default the pack to emoji usage, but the import callback has no usage parameter yet; and the whole flow needs a manual test in the built app.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
robocub/vommet#2
No description provided.