Options
All
  • Public
  • Public/Protected
  • All
Menu

TG Sticker Creator Documentation

tg-sticker-creator - A Library for Creating Telegram Stickers

Alpha Version

Works in most browsers and nodejs

CI Coverage

Full Example (Try it in the online editor)

import pako from "pako";
import download from "downloadjs";

import { create } from "tg-sticker-creator";

const mySticker = create
.sticker()
.setFrameRate(30)
.setFinalFrame(40)
.addLayerFront(
create.shapeLayer().addShapeBack(
create
.group()
.addShapeBack(
create
.ellipse()
.setPosition(create.value(156, 156).addKeyframe(10, [356, 156]).addKeyframe(20, [356, 356], "easeInOutCubic").addKeyframe(30, [156, 356]).addKeyframe(40, [156, 156]))
.setSize(create.value([15, 15]))
)
.addShapeBack(create.fill().setColor(create.color("#ffff00")))
.addShapeBack(create.transform())
)
);

download(new Blob([pako.gzip(mySticker.toTgsString({ precision: Infinity }), { level: 9 })]), "sticker.tgs", "application/gzip");

License

GNU Affero General Public License

Thanks

I took a few ideas (and code) from these projects:

Developing

pnpm i
pnpm test:watch
pnpm commit

Generated using TypeDoc