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

botogram 0.2.x crashes with edited messages #70

Closed
pietroalbini opened this issue Jul 2, 2016 · 1 comment
Closed

botogram 0.2.x crashes with edited messages #70

pietroalbini opened this issue Jul 2, 2016 · 1 comment
Assignees
Labels

Comments

@pietroalbini
Copy link
Contributor

pietroalbini commented Jul 2, 2016

An user reported this crash on the Telegram group:

Traceback (most recent call last):
  File "C:\...\botogram\runner\processes.py", line 54, in run
    self.loop()
  File "C:\...\botogram\runner\processes.py", line 207, in loop
    if update.message.date < self.started_at:
AttributeError: 'NoneType' object has no attribute 'date'

botogram version: 0.2.1

@pietroalbini pietroalbini self-assigned this Jul 2, 2016
@pietroalbini
Copy link
Contributor Author

Apparently this has to do with edited messages, which creates trouble in botogram 0.2. Another traceback:

Traceback (most recent call last):
  File "/.../botogram/runner/processes.py", line 54, in run
    self.loop()
  File "/.../botogram/runner/processes.py", line 158, in loop
    job.process(self.bots)
  File "/.../botogram/runner/jobs.py", line 87, in process
    return self.func(bot, self.metadata)
  File "/.../botogram/runner/jobs.py", line 96, in process_update
    bot.process(update)
  File "/.../botogram/frozenbot.py", line 144, in process
    result = hook.call(self, update)
  File "/.../botogram/hooks.py", line 43, in call
    if self._only_texts and update.message.text is None:

@pietroalbini pietroalbini changed the title Crash with botogram 0.2.1 botogram 0.2.x crashes with edited messages Jul 2, 2016
@pietroalbini pietroalbini added this to the botogram 0.2.2 milestone Jul 2, 2016
pietroalbini pushed a commit that referenced this issue Jul 2, 2016
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant