Blog and knowledge base of the service

Sending a sticker in the Telegram bot

An animated Telegram message is a unique visual format for emotional communication in Telegram. Stickers are static (WEBP) or animated (TGS) images optimized for fast sending and automatic playback. They don't support text, but they can be accompanied by interactive buttons. Each sticker belongs to a specific pack created through @StickersBot, which ensures consistent design.

Sending a sticker in the Telegram bot

What formats does the sticker accept in Telegram and what are the limitations?

Telegram provides different image formats for different types of stickers.:

  1. PNG. Suitable for static stickers. The format provides high-quality images and a transparent background. The size of the sticker is 512×512 pixels. 
  2. WEBP. The format for animated stickers. Allows you to create creative and picturesque animations. The sticker size is also 512×512 pixels.
  3. TGS. Telegram's special format for animated stickers. The animation duration cannot exceed 3 seconds, and the frame rate is 30 or 60 FPS. The canvas size is 512×512 pixels. 


Some restrictions:

1. Resolution:

- Min.: 100×100 px,

- Max.: 512×512 px (512×512 is recommended for clarity). 

2. Transparency: Required (background is removed automatically). 

3. Preview: A square preview is generated automatically.

4. Animation:

- TGS only (Telegram format),

- Max. duration: 3 seconds,

- Max. frame rate: 60 FPS.

Popular mistakes when sending a sticker

400 Bad Request: STICKER_PNG_NOPNG

- Reason: PNG was sent instead of WEBP/TGS. 

- Solution: Convert to WEBP: 

400 Bad Request: STICKER_TGS_NOTGS

- Reason: Invalid TGS file. 

- Solution: Check the animation via [tgsviewer](https://www.tgsviewer.com /).

400 Bad Request: Invalid sticker emojis

- Reason: When creating the set, non-existent emojis were specified. 

- Solution: Use only standard emojis (✅: 😊, ❤️, ⭐️). 

400 Bad Request: Sticker set name invalid

- Reason: The name of the set contains forbidden characters. 

- Solution: Use Latin letters and underscores: my_cool_pack. 

403 Forbidden: Bot is not a sticker set owner

- Solution: Create sets only through the account that created the stickers. 

Information

Technical information for the BOT-MARKET API

  1. - Message type code (`MessageType'): "10" (for `sendSticker'). 
  2. - Max. Sending speed: 30 stickers/second (due to the low weight of the files). 
  3. - Set limits:

    - Static: up to 120 stickers per pack, 

    - Animated: up to 50 stickers per pack. 

Tips for effective use

1. Design rules:

  - Contour: 2-3 px stroke for contrast on any background. 

  - Size: 512×512 px with transparency → Telegram scales itself to 100-200 px in the chat.

2. Promotion of kits:

  - Add a button under the sticker