Skip to content

feat(contacts): favorite aliases resolved everywhere; fix session generator 2FA retry and non-interactive stdin - #173

Merged
chigwell merged 1 commit into
chigwell:mainfrom
ex3lite:feat/contact-aliases-and-qr-fixes
Jul 30, 2026
Merged

feat(contacts): favorite aliases resolved everywhere; fix session generator 2FA retry and non-interactive stdin#173
chigwell merged 1 commit into
chigwell:mainfrom
ex3lite:feat/contact-aliases-and-qr-fixes

Conversation

@ex3lite

@ex3lite ex3lite commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What

Favorite contact aliases

  • New tools: set_contact_alias, list_contact_aliases, delete_contact_alias.
  • Aliases live in aliases.json (gitignored), case-insensitive, leading @ ignored.
  • Resolution is wired into resolve_entity / resolve_input_entity, so every tool that accepts a chat_id understands an alias — send, forward, media, admin ops, etc. Example: save "andrew" once, then send_message("andrew", ...) just works.
  • search_contacts returns matching favorites at the top, so MCP clients pick the intended person deterministically instead of guessing between similarly-named contacts.

Session string generator fixes (hit these in real use)

  • QR login + 2FA: a wrong cloud password raised PasswordHashInvalidError and crashed the generator, forcing a full re-scan. Now it re-prompts until the password is correct.
  • Non-interactive stdin (piped/scripted runs): input() for the account label and the .env-update prompt raised EOFError and tracebacked. Now label defaults to empty and the .env prompt defaults to No.

Tests

  • tests/test_aliases.py: alias apply/passthrough, corrupt/missing file, roundtrip.
  • tests/test_session_string_generator.py: new test for 2FA retry on invalid password.
  • black . clean, flake8 critical checks clean, 67 tests pass locally.

🤖 Generated with Claude Code

…nteractive stdin

- Add favorite contact aliases stored in aliases.json: set_contact_alias,
  list_contact_aliases, delete_contact_alias tools. Aliases are resolved
  in resolve_entity/resolve_input_entity, so every tool accepting a
  chat_id understands them; search_contacts returns matching favorites
  first.
- QR login: retry the 2FA password prompt on PasswordHashInvalidError
  instead of crashing and forcing a re-scan.
- Session generator: handle EOF on the label and .env-update prompts so
  piped/scripted runs don't traceback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chigwell
chigwell merged commit 89d6bad into chigwell:main Jul 30, 2026
4 checks passed
KiaroSama pushed a commit to KiaroSama/telegram-mcp that referenced this pull request Aug 25, 2026
…-qr-fixes

feat(contacts): favorite aliases resolved everywhere; fix session generator 2FA retry and non-interactive stdin
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.

2 participants