Skip to content

Conversation

rahiel
Copy link
Contributor

@rahiel rahiel commented Jun 12, 2016

I had a weird crash where I received an update without a message, so the call to update.message.text crashed it. This takes care of that and the case where an update leads to an Unauthorized exception when len(bot.getUpdates()) > 1.

We also say goodbye to roboed.py, it does not teach more than echobot and I am too lazy to update its exception handling code.

# Request updates after the last update_id
for update in bot.getUpdates(offset=update_id, timeout=10):
# chat_id is required to reply to any message
chat_id = update.message.chat_id
update_id = update.update_id + 1
if not update.message: # we ignore updates without messages
Copy link
Member

@leandrotoledo leandrotoledo Jun 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates without messages could be edited messages since Bot 2.0 changes, nice catch.

@leandrotoledo
Copy link
Member

Minor comments, other than that looks good to me.

So long and thanks for all the fish roboed.py

@leandrotoledo
Copy link
Member

Nailed it! Good to be merged.

@rahiel rahiel merged commit 9338f93 into master Jun 12, 2016
@leandrotoledo leandrotoledo deleted the examples branch June 12, 2016 15:15
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔌 enhancement pr description: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants