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.message_get should require string instead of int/long #66

Closed
ender-null opened this issue Feb 24, 2016 · 3 comments
Closed

sender.message_get should require string instead of int/long #66

ender-null opened this issue Feb 24, 2016 · 3 comments
Labels

Comments

@ender-null
Copy link

sender.message_get requires int/long, but new Permanent Message IDs are alphanumeric so it doesn't work.

@luckydonald
Copy link
Owner

Beautiful.
What parameter? Can you provide a stacktrace please?

@ender-null
Copy link
Author

reply_id = '02000000533787000caf0e00000000000000000000000000'
sender.message_get(reply_id)
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 389, in _validate_input
    arg_value = func_type.parse(arg)
  File "/usr/local/lib/python3.4/dist-packages/pytg/argument_types.py", line 160, in parse
    value = super(NonNegativeNumber, self).parse(value)
  File "/usr/local/lib/python3.4/dist-packages/pytg/argument_types.py", line 142, in parse
    raise ArgumentParseError("Not a int/long")
pytg.exceptions.ArgumentParseError: Not a int/long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "/home/luxie/Projects/sakubo/core/bindings/tg.py", line 114, in inbox_listen
    tgreceiver.message(listener())
  File "/usr/local/lib/python3.4/dist-packages/pytg/utils.py", line 29, in start
    cr = func(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/pytg/receiver.py", line 212, in message
    function.send(message)
  File "/home/luxie/Projects/sakubo/core/bindings/tg.py", line 75, in listener
    reply_msg = tgsender.message_get(msg['reply_id'])
  File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 612, in command_alias
    return self.execute_function(command_name, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 270, in execute_function
    command_name, new_args = self._validate_input(function_name, arguments)
  File "/usr/local/lib/python3.4/dist-packages/pytg/sender.py", line 396, in _validate_input
    function_name=function_name, number=i, type=func_type.__class__.__name__, param=str(func_type), error=str(err)))
ValueError: Error in function message_get: parameter #0 <msg_id> is not type NonNegativeNumber. (Not a int/long)

@luckydonald
Copy link
Owner

Fixed by 52e9390.

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