← Back to PRs

#6516: feat(telegram): add sticker and custom emoji vision support

by Shabablinchikow open 2026-02-01 19:00 View on GitHub →
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