#6516: feat(telegram): add sticker and custom emoji vision support
channel: telegram
Adds AI-powered vision support for Telegram stickers and custom emoji
## Why?
Cause it’s fun and makes OpenClaw understand the nuances of your and your friends' chronically online writing
## What does this PR do?
* adds 2 new configs: `telegramCfg.stickerVision` and `telegramCfg.customEmojiVision` to control if the user wants to burn tokens for getting more context to OpenClaw
* adds a cache layer to store text descriptions of stickers and custom emojis (also, Telegram allows bots to send stickers, and it’s a good base to teach bots funny stickers, but I can’t consistently make my OpenClaw not spam me stickers after each message, so not now)
---
Code was mostly written with Claude Code and run for a week in a few chats, so it’s kinda battle-tested
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds Telegram “vision” enrichment for stickers and custom emojis, gated by two new config flags (`stickerVision`, `customEmojiVision`). It introduces small cache layers (JSON in `STATE_DIR/telegram/…`) to store 1–2 sentence descriptions, expands Telegram message entity processing to annotate custom emojis in text, and adds a shared vision helper to select a suitable vision-capable model/provider based on configured API keys.
Main codepaths affected are inbound Telegram message handling (collecting media/custom emoji metadata and cache hits) and outbound dispatch (optionally describing/caching the media and injecting descriptions into the prompt instead of sending the image).
<h3>Confidence Score: 3/5</h3>
- Moderately safe to merge, but there are a couple of correctness/maintainability issues worth fixing first.
- The feature is conceptually well-scoped and includes tests for entity expansion and caching, but file-level `@ts-nocheck` in core Telegram paths can hide real runtime errors, and `describeImageWithVision` currently hardcodes a WebP MIME type which can be wrong depending on downloaded media.
- src/telegram/bot-message-dispatch.ts, src/telegram/bot-handlers.ts, src/telegram/vision-describe.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13278: feat(telegram): full sticker support — thumbnail fallback, set inde...
by thebtf · 2026-02-10
85.4%
#19056: feat(inbound-meta): expose sticker metadata in system prompt
by xuandung38 · 2026-02-17
76.4%
#7902: feat: Implement Telegram video note support with tests and docs
by thewulf7 · 2026-02-03
75.3%
#7980: feat(telegram): multi-stage reaction system for message pipeline vi...
by macmimi23 · 2026-02-03
75.3%
#21898: fix(telegram): auto-detect captionable messages for editMessageCaption
by ptrkstr · 2026-02-20
74.1%
#21029: Feature/telegram bot avatar clean
by aleonnet · 2026-02-19
74.0%
#14367: feat(telegram): add message read via inbound message store
by michaelquinlan88 · 2026-02-12
73.8%
#21346: [AI-assisted] Telegram: add reaction state machine with fallback an...
by Archie818 · 2026-02-19
73.5%
#22434: feat(telegram): support sending original quality images
by godenjan · 2026-02-21
73.0%
#9577: feat: Add apiRoot option for custom Telegram Bot API server endpoint
by vfiee · 2026-02-05
72.9%