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

Commands and \n after aren't processed by CommandHandler #868

Closed
vikanezrimaya opened this issue Oct 12, 2017 · 5 comments · Fixed by #869
Closed

Commands and \n after aren't processed by CommandHandler #868

vikanezrimaya opened this issue Oct 12, 2017 · 5 comments · Fixed by #869

Comments

@vikanezrimaya
Copy link

Steps to reproduce

  1. Make a bot with a CommandHandler

  2. Send a command with \n after it without space! Like this:

/feedback
some text

Expected behaviour

Command should not be ignored...

Actual behaviour

...but it is ignored instead

Configuration

Operating System:
Gentoo

Version of Python, python-telegram-bot & dependencies:

$ python -m telegram

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/kisik21/Projects/Nadeko/.virtualenv/lib64/python3.6/site-packages/telegram/__main__.py", line 3, in <module>
    import urllib3
ModuleNotFoundError: No module named 'urllib3'

Okay, I installed urllib3...

python-telegram-bot 6.1.0
urllib3 1.22
certifi 2017.04.17
future 0.16.0
Python 3.6.1 (default, Sep 25 2017, 22:51:25)  [GCC 5.4.0]

Logs

Don't think this applies here.

The issue is probably the CommandHandler - I read the code, it thinks of \n as a part of command string. We need to strip these while detecting command names, I think...

@Eldinnie
Copy link
Member

Hi,

Thanks for reporting this. We will take action soon.

@tsnoam
Copy link
Member

tsnoam commented Oct 12, 2017

@kisik21 re: urllib3
you are using an old version of ptb. you should upgrade to the latest which comes with a vendored version of urllib3.
best way is to upgrade using pip, but if you prefer to use sources, please make sure to follow the README in order to properly get the sources including the git submodules.

@vikanezrimaya
Copy link
Author

@tsnoam re: re: urllib3

pip install --upgrade python-telegram-bot gave me the same 8.0 I was running.

@tsnoam
Copy link
Member

tsnoam commented Oct 12, 2017

@kisik21 that conflicts with the version you specified in the initial report.
anyhow, it doesn't matter. fix for the actual issue is in the works.

@vikanezrimaya
Copy link
Author

@tsnoam oh, yeah, I accidentally mistaken one venv for another.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants