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

Fix bot crash on telegram egghatch #5270

Merged
merged 5 commits into from
Sep 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pokemongo_bot/event_handlers/telegram_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def handle_event(self, event, sender, level, formatted_msg, data):
elif event == 'pokemon_caught':
msg = "Caught {} CP: {}, IV: {}".format(data["pokemon"], data["cp"], data["iv"])
elif event == 'egg_hatched':
msg = "Egg hatched with a {} CP: {}, IV: {}".format(data["pokemon"], data["cp"], data["iv"])
msg = "Egg hatched with a {} CP: {}, IV: {} {}".format(data["name"], data["cp"], data["iv_ads"], data["iv_pct"])
elif event == 'bot_sleep':
msg = "I am too tired, I will take a sleep till {}.".format(data["wake"])
elif event == 'catch_limit':
Expand Down Expand Up @@ -406,10 +406,7 @@ def handle_event(self, event, sender, level, formatted_msg, data):
else:
return
elif event == 'egg_hatched':
try:
msg = "Egg hatched with a {} CP: {}, IV: {}".format(data["pokemon"], data["cp"], data["iv"])
except KeyError:
return
msg = "Egg hatched with a {} CP: {}, IV: {} {}".format(data["name"], data["cp"], data["iv_ads"], data["iv_pct"])
elif event == 'bot_sleep':
msg = "I am too tired, I will take a sleep till {}.".format(data["wake"])
elif event == 'catch_limit':
Expand Down