Skip to content

Commit 56fca06

Browse files
author
Pietro Albini
committed
Fix botogram crashing if someone edits a message
The Bot API 2.1 update (not supported by botogram 0.2.x) introduced a new kind of Update when someone edits a message the bot knows about. This allows to create cool things, but it isn't supported by botogram 0.2.x, since support for it was added in botogram 0.3.1. Unfortunately, this meant botogram crashed when it received that kind of update. This commit ignores every update other than the ones it supports, so the fix lasts even for new kind of updates not introduced yet. Fixes: GH-70
1 parent 7cdd77b commit 56fca06

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

botogram/runner/processes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ def loop(self):
201201
return
202202

203203
for update in updates:
204+
# botogram 0.2.x doesn't support anything but messages, ignore the
205+
# other things -- Fix issue GH-70
206+
if update.message is None:
207+
continue
208+
204209
self.last_id = update.update_id
205210

206211
if not self.backlog_processed:

docs/changelog.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ botogram changelog
99

1010
Here you can see what changed in every botogram release.
1111

12+
.. _changelog-0.2.2:
13+
14+
botogram 0.2.2
15+
==============
16+
17+
*Bugfix release, not yet released*
18+
19+
* Fix botogram crashing if someone edits a message (`issue 70`_)
20+
21+
.. _issue 70: https://github.com/pietroalbini/botogram/issues/70
22+
1223
.. _changelog-0.2.1:
1324

1425
botogram 0.2.1

0 commit comments

Comments
 (0)