Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sender.contacts_search() has invalid parser. #51

Closed
gregvirgin opened this issue Nov 5, 2015 · 4 comments
Closed

sender.contacts_search() has invalid parser. #51

gregvirgin opened this issue Nov 5, 2015 · 4 comments
Labels

Comments

@gregvirgin
Copy link

Doesn't matter what I put into it, queries that work in telegram-cli don't work at all here.

>>> sender.contacts_search("luckydonald")
DEBUG:pytg.sender:Parsing contacts_search: Argument luckydonald - <user_name> (needed)
DEBUG:pytg.sender:Skipping missing optional parameter #1 [limit] (type NonNegativeNumber) in function contacts_search.
DEBUG:pytg.sender:Sending command > [disable_preview] contact_search 'luckydonald'
<
DEBUG:pytg.sender:Socket Connected.
DEBUG:pytg.sender:All Sent.
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/DictObject/__init__.py", line 435, in __getattr__
    value = dict.__getattribute__(self, n(name))  # Raise exception if not found in original dict's attributes either
AttributeError: 'DictObject' object has no attribute 'result'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/DictObject/__init__.py", line 442, in __getattr__
    key_name = self._attribute_to_key_map[n(name)]  # Check if we have this set.
KeyError: 'result'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/pytg-0.4.1d-py3.4.egg/pytg/sender.py", line 548, in command_alias
  File "/usr/local/lib/python3.4/dist-packages/pytg-0.4.1d-py3.4.egg/pytg/sender.py", line 275, in execute_function
  File "/usr/local/lib/python3.4/dist-packages/pytg-0.4.1d-py3.4.egg/pytg/result_parser.py", line 30, in success_fail
  File "/usr/local/lib/python3.4/dist-packages/DictObject/__init__.py", line 456, in __getattr__
    raise suppress_context(AttributeError(name))
AttributeError: result
@luckydonald
Copy link
Owner

Can you please post the output in the telegram cli, when you start it with the --json flag?

@luckydonald
Copy link
Owner

[disable_preview] contact_search 'luckydonald' (someone already in contacts)

{"id": 10717954, "type": "user", "print_name": "luckydonald", "flags": 259, "first_name": "luckydonald", "last_name": "", "phone": "1234", "username": "luckydonald"}

[disable_preview] contact_search 'vysheng' (someone not in contacts)

{"id": 414655, "type": "user", "print_name": "Vitaly_Valtman", "flags": 256, "first_name": "Vitaly", "last_name": "Valtman", "username": "vysheng"}

both have:

  • id
  • type
  • print name
  • flags
  • first_name
  • last_name
  • username

@luckydonald
Copy link
Owner

Okey, needs some parser.

@luckydonald luckydonald changed the title sender.contacts_search() does not work sender.contacts_search() has invalid parser. Dec 7, 2015
@luckydonald
Copy link
Owner

For now the something parser is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants