#7911: Unapproved users receive pairing codes on every /start message before approval.
channel: telegram
stale
Cluster:
Messaging Platform Improvements
Unapproved users receive pairing codes on every /start message before approval. Use when users need to repeatedly access pairing codes after the initial request, ensuring consistent access to pairing instructions even if the initial code was missed or lost.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adjusts Telegram DM pairing behavior for unauthorized users under `dmPolicy === "pairing"`: instead of only replying with pairing instructions when a pairing request is newly created, it now replies whenever a pairing `code` exists, so users can re-request the pairing code by sending another message.
The change is localized to `src/telegram/bot-message-context.ts` within the DM access-control block that calls `upsertChannelPairingRequest` and conditionally sends a pairing message back to the user.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge; it’s a narrow behavior change in the Telegram pairing reply path.
- The diff is a one-line condition change that aligns with the stated goal (always return the pairing code for unapproved users). Main remaining concern is a small maintainability/lint issue (`created` becomes unused) and loss of a useful logging signal; no broader control-flow or security-sensitive logic is modified.
- src/telegram/bot-message-context.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#8653: Docs: clarify DM pairing approve command
by adityasingh2400 · 2026-02-04
83.8%
#8985: fix(telegram): preserve forum topic context for pairing auto-replies
by lailoo · 2026-02-04
83.6%
#11249: fix(whatsapp): prevent pairing-mode auto-replies to unknown DMs
by liuxiaopai-ai · 2026-02-07
80.5%
#13285: feat(pairing): add pairingAnonymous option to hide platform branding
by thebtf · 2026-02-10
80.1%
#19213: Telegram: preserve DM topic thread in direct replies
by Kemalau · 2026-02-17
77.3%
#14789: fix: per-account dmPolicy ignored in checkInboundAccessControl
by croll83 · 2026-02-12
77.3%
#6265: feat(whatsapp): add pairing owner notification
by zote · 2026-02-01
77.3%
#6567: fix: include paired users in WhatsApp group sender allowlist
by giannisanni · 2026-02-01
77.1%
#17882: fix: drop WhatsApp pairing reply for unconfigured accounts
by adit-negi · 2026-02-16
75.1%
#23692: fix(pairing): add brute-force protection for DM pairing codes
by widingmarcus-cyber · 2026-02-22
74.9%