Repository navigation
feat: add optional reaction on incoming messages - #31
Open
TiaraBasori wants to merge 2 commits into
Open
TiaraBasori wants to merge 2 commits into
TiaraBasori wants to merge 2 commits into
Conversation
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 "❤".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
TELEPI_REACTION_ON_RECEIPT(defaultfalse, so existing behavior is unchanged). Acceptstrue/falseplus1/0,yes/no,on/off; invalid values warn and fall back tofalse.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❤.setMessageReactioncall is logged and never interrupts prompt processing.README.mdand.env.example.Config / deployment impact
Two optional env vars. No changes required for existing setups; add
TELEPI_REACTION_ON_RECEIPT=truetoconfig.env(installed mode) or.env(source checkout) to enable, and optionallyTELEPI_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.tsc --noEmitandnpm run buildclean.