This is basically a wrapper around the Telegram Bot API that only provides access to sticker data.
It aggressively caches sticker image data both on-disk and in the Cache-Control header, both to save requests to Telegram and to save requests from clients.
It is suitable for public use -- no API tokens are required.
Create config.json:
{
"BOT_TOKEN": "Something",
"CACHE_TIME": 3600
}
Then:
npm install
node index
In production, you can use environment variables instead of config.json.
Then, simply use these endpoints:
GET /pack/:name
GET /sticker/:id.png
Examples:
(Please do not use stickers.horner.tj in production. It is not stable and may go down at any time. It is simply for demonstration purposes.)
A Dockerfile is included in this repo, but prebuilt images are available:
docker pull tjhorner/tstickers-api:latest
For your reference, a sample docker-compose.yml is also included.
Content type
Image
Digest
Size
48.4 MB
Last updated
over 7 years ago
docker pull tjhorner/tstickers-api