X Tutup
Skip to content

RegexHandler error with stickers, voices, images... #750

@jossalgon

Description

@jossalgon

RegexHandler does not check if update.effective_message.text exists.

Steps to reproduce

  1. Add a RegexHandler
  2. Run the bot
  3. Send a sticker

Expected behaviour

The handler should not capture the sticker

Actual behaviour

The handler capture the sticker and gives an error

Configuration

Does not matter

Version of Python, python-telegram-bot & dependencies:

python-telegram-bot 7.0.0

Logs

2017-07-26 14:02:47,301 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/dispatcher.py", line 269, in process_update
if handler.check_update(update):
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/regexhandler.py", line 150, in check_update
match = re.match(self.pattern, update.effective_message.text)
File "/usr/lib/python3.5/re.py", line 163, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup