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

telegram_handler : TypeError: expected string or buffer #5129

Closed
yeawellwhatever opened this issue Sep 3, 2016 · 3 comments
Closed

telegram_handler : TypeError: expected string or buffer #5129

yeawellwhatever opened this issue Sep 3, 2016 · 3 comments

Comments

@yeawellwhatever
Copy link

Expected Behavior

Bot to run and telegram to respond to /info request.

Actual Behavior

The telegram handler crashes

Your FULL config.json (remove your username, password, gmapkey and any other private info)

"type": "TelegramTask",
"config": {
"enabled": true,
"master": null,
"// old syntax, still supported: alert_catch": ["all"],
"// new syntax:": {},
"alert_catch": {
"all": {"operator": "and", "cp": 1300, "iv": 0.95},
"Snorlax": {"operator": "or", "cp": 900, "iv": 0.9}

Output when issue occurred

Traceback (most recent call last):
File "/home/felis/PokemonGo-Bot/local/lib/python2.7/site-packages/eventlet/hubs/poll.py", line 115, in wait
listener.cb(fileno)
File "/home/felis/PokemonGo-Bot/local/lib/python2.7/site-packages/eventlet/green/thread.py", line 41, in __thread_body
func(_args, *_kwargs)
File "/home/felis/PokemonGo-Bot/pokemongo_bot/event_handlers/telegram_handler.py", line 82, in run
if not re.match(r'^[0-9]+$', self.master):
File "/home/felis/PokemonGo-Bot/lib/python2.7/re.py", line 141, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or buffer
Removing descriptor: 16

Steps to Reproduce

Unsure how it started. Now the error happens every startup since the bot is receiving a previous /info request.
master: null is on purpose. Multiple people are watching the same bot instance, so we don't need push notification.

Other Information

OS: Ubuntu 16.04.1

Branch: dev

Git Commit: c270999

Python Version: Python 2.7.12

Any other relevant files/configs (eg: path files)

@Gobberwart
Copy link
Contributor

Should be fixed by #5136

@inakimalerba
Copy link

Your referenced pull request was closed @Gobberwart, and this fix is not in master. I fixed it myself on my local code but when running on docker it pulls master and breaks Telegram integration. Can you merge this? Thanks.

@Gobberwart
Copy link
Contributor

It will be fixed in master next time a merge is done from dev to master. We don't generally push to master until sufficient testing is completed in dev. In other words, no I won't merge it :)

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

No branches or pull requests

3 participants