Skip to content

feat(tui): add /like to react to the newest message from others - #43

Merged
t0d0r merged 1 commit into
masterfrom
feature/like
Nov 6, 2026
Merged

t0d0r merged 1 commit into
masterfrom
feature/like

Conversation

@t0d0r

@t0d0r t0d0r commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds /like [name] to react to the newest received message in the current chat.
  • Supports the documented fixed Telegram reaction vocabulary and tab completion.
  • Uses explicit status/errors and offline provider coverage; no live Telegram reaction was sent during validation.

Verification

  • make check
  • go test -race ./internal/command ./internal/tui
  • FUZZTIME=2s make fuzz
  • gitleaks git --no-banner .
  • git diff --check origin/master...feature/like

/like [name] sets the account's reaction on one message of the current
chat window: the newest message lazygram holds of that chat that
someone other than the account sent (domain.LastFromOthers), so own
lines after it are skipped and never more than one message is touched.

The name comes from a fixed vocabulary matched without regard to case,
each an emoji of Telegram's standard reaction set as the Bot API lists
it: like (the default, thumbs up; also +1), dislike (-1), love (heart,
U+2764 without U+FE0F), fire, laugh, sad, party (tada), clap, thanks
(pray), ok, think, eyes. Tab completes the twelve names.

Checks go from the form to the state and send nothing: another name is
"/like takes like, dislike, ... think or eyes" in any window; window 0
is the shared chat-window error; a provider without provider.Reactor is
"reactions cannot be sent with <provider>"; no target is "no message
from someone else in <chat> to react to". Otherwise the status says
"reacting E to ada \"first words\"...", then "reacted ..."; reactions
the answer carries are applied like a poll's; a failure is "reaction
failed: <why>" in the status and window 0. Nothing is focused or read.

provider.Reactor is a new optional interface. Telegram sends
messages.sendReaction with one reactionEmoji (big and add_to_recent
unset, FLOOD_WAIT retried once), returns any updateMessageReactions of
the answer, tells the documented refusals in words with their code and
takes MESSAGE_NOT_MODIFIED as done. The demo sets the reaction in
memory, replacing the account's earlier one and keeping a paid star.

Removing a reaction is left out: the API documentation read does not
say an empty list removes one (todo). No reaction was sent to a real
account: Telegram code is tested with the fake api, the TUI with a fake
provider and the offline demo.

specs/ui.md (Reactions, Sending a reaction, with decisions; commands
table, short forms, Completion, hints), specs/providers.md (Reactor,
Telegram sending, demo), docs/usage.md, /help, a start hint, todo and
session/2026-11-06-like.md with the RED/GREEN record are updated.
@t0d0r
t0d0r merged commit 1c186e3 into master Nov 6, 2026
4 checks passed
@t0d0r
t0d0r deleted the feature/like branch November 6, 2026 21:46
t0d0r added a commit that referenced this pull request Nov 6, 2026
The Arch / Omarchy recipe builds v0.4.30: only pkgver and the tag
tarball's sha256 (87c91787...cda83, the same on two downloads) change;
go.mod and go.sum are as in 0.4.29. It was built and tested in Docker
on aarch64 and x86_64 (makepkg with check, namcap, pacman -Qkk, the
desktop entry, lazygram 0.4.30), and the omarchy-pkgs validators pass
against their master bf44164. omacom/omarchy-pkgs#2022 moved to 0.4.30
with 20cc7d0; PR.md names it.

session/2026-11-07-release-0430.md records the release: v0.4.30 tagged
on master 1c186e3 (/like, #43), published by Release workflow run
42299863267, every asset checked against SHA256SUMS and its provenance
verified online and offline, a tampered tarball refused, the latest
installer URL installing v0.4.30 into a scratch prefix, and the
Homebrew formula at 0.4.30 (tap 49f8b9f, built from source, brew test
passed). todo/todo.md, specs/release.md and docs/arch-omarchy.md follow
the version.
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