Skip to content

feat: add optional reaction on incoming messages - #31

Open
TiaraBasori wants to merge 2 commits into
benedict2310:mainfrom
TiaraBasori:feat/reaction-on-receipt
Open

TiaraBasori wants to merge 2 commits into
benedict2310:mainfrom
TiaraBasori:feat/reaction-on-receipt

Conversation

@TiaraBasori

@TiaraBasori TiaraBasori commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

When steering a coding agent from your phone, it is easy to wonder whether TelePi actually picked up your prompt — especially on slow connections or while the bot is busy. This PR adds an opt-in acknowledgment reaction: TelePi reacts (👀 by default) to the incoming message as soon as an allowed user's text, photo/document, or voice/audio message is received.

  • New config flag TELEPI_REACTION_ON_RECEIPT (default false, so existing behavior is unchanged). Accepts true/false plus 1/0, yes/no, on/off; invalid values warn and fall back to false.
  • New optional TELEPI_REACTION_EMOJIS (comma/space-separated, default 👀). With several emojis, one is picked at random per message; U+FE0F variation selectors are stripped so ❤️ maps to Telegram's ❤.
  • Reactions are fire-and-forget: a rejected or failed setMessageReaction call is logged and never interrupts prompt processing.
  • Documented in README.md and .env.example.

Config / deployment impact

Two optional env vars. No changes required for existing setups; add TELEPI_REACTION_ON_RECEIPT=true to config.env (installed mode) or .env (source checkout) to enable, and optionally TELEPI_REACTION_EMOJIS=👀,👍,🔥 to customize.

Testing

  • test/config.test.ts: default value, accepted true/false variants, invalid-value fallback warning; emoji list parsing (default, comma/space separators, dedupe, FE0F stripping, empty fallback).
  • test/bot.test.ts: reaction sent for text/photo/voice when enabled, not sent when disabled, random pick from the configured list, and prompt flow continues when the reaction request fails.
  • Full suite: 32 files, 467 passed, 1 skipped. tsc --noEmit and npm run build clean.

TiaraBasori and others added 2 commits September 25, 2026 15:58
Add TELEPI_REACTION_ON_RECEIPT (default false). When enabled, TelePi
reacts with 👀 to incoming text, photo/document, and voice/audio
messages so the owner can see the prompt was received. Reaction
failures are logged and never interrupt prompt processing.
Add TELEPI_REACTION_EMOJIS (comma/space-separated, default 👀). When
several emojis are configured, one is picked at random per message.
U+FE0F variation selectors are stripped so "❤️" maps to Telegram's "❤".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant