Repository navigation
fix(contacts): import_contacts used a class that does not exist - #339
Merged
Merged
Conversation
functions.contacts.InputPhoneContact does not exist (the type lives in telethon.types), so every call raised AttributeError and nothing was sent to Telegram. Use types.InputPhoneContact and explain a malformed contact instead of failing on a KeyError. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018Xun6C4mXUAKbVSmiEEh79
chigwell
approved these changes
Oct 20, 2026
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
import_contactsreferencedfunctions.contacts.InputPhoneContact, which does not exist in Telethon — every call failed withAttributeErrorbefore reaching the API. The correct class istypes.InputPhoneContact(telethon.tl.types).While touching it, the input is validated up front (every contact needs
phoneandfirst_name) so the tool refuses a malformed list with a readable message instead of failing mid-import, and a missinglast_namemaps to""instead ofNone.Testing
tests/test_import_contacts.pycovers the class resolution and the malformed-input refusal.🤖 Generated with Claude Code