feat(tg-bot): unpin auto-forwarded channel posts #257

Merged
developer merged 1 commits from feature/tg-unpin-linked-channel-post into development 2026-07-13 22:13:15 +00:00
Owner

Telegram non-disableably auto-pins each channel post it auto-forwards into the linked discussion group (TELEGRAM_CHAT_ID). The bot now detects that message by Message.is_automatic_forward in the moderated chat and unpins it by id (unpinChatMessage), so a pin set by a human admin — or by the bot for another message — is never touched (never unpinAllChatMessages).

Detection is reliable: the flag is set only by Telegram and only for the linked-channel auto-forward. Privacy mode is not a factor — an admin bot (which it must be to unpin) receives all messages.

Owner-side prerequisite: grant the bot the pin-messages right (can_pin_messages) in the discussion group; without it the unpin no-ops and the startup self-check now logs a warning.

Bot-only; no wire/schema/DB change. Tests: filter (only auto-forward), point unpin by id, foreign-chat ignored.

Telegram non-disableably auto-pins each channel post it auto-forwards into the linked discussion group (`TELEGRAM_CHAT_ID`). The bot now detects that message by `Message.is_automatic_forward` in the moderated chat and unpins it **by id** (`unpinChatMessage`), so a pin set by a human admin — or by the bot for another message — is never touched (never `unpinAllChatMessages`). Detection is reliable: the flag is set only by Telegram and only for the linked-channel auto-forward. Privacy mode is not a factor — an admin bot (which it must be to unpin) receives all messages. **Owner-side prerequisite:** grant the bot the **pin-messages** right (`can_pin_messages`) in the discussion group; without it the unpin no-ops and the startup self-check now logs a warning. Bot-only; no wire/schema/DB change. Tests: filter (only auto-forward), point unpin by id, foreign-chat ignored.
developer added 1 commit 2026-07-13 22:08:04 +00:00
feat(tg-bot): unpin auto-forwarded channel posts
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 20s
CI / ui (pull_request) Has been skipped
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m56s
3b485883ee
Telegram non-disableably auto-pins each channel post it auto-forwards
into the linked discussion group. The bot now detects that message by
Message.is_automatic_forward in the moderated chat (TELEGRAM_CHAT_ID)
and unpins it by id, so a pin set by a human admin — or by the bot for
another message — is never touched (no unpinAllChatMessages).

Needs the can_pin_messages right in the chat; the startup self-check
now also warns when it is missing. Bot-only; no wire/schema/DB change.
owner approved these changes 2026-07-13 22:12:44 +00:00
developer merged commit 522beec82e into development 2026-07-13 22:13:15 +00:00
developer deleted branch feature/tg-unpin-linked-channel-post 2026-07-13 22:13:15 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#257