# Buggy code
def __init__(
    self,
    filters,
    callback,
    pass_update_queue=False,
    pass_job_queue=False,
    pass_user_data=False,
    pass_chat_data=False,
    message_updates=None,
    channel_post_updates=None,
    edited_updates=None,
):
    super().__init__(
        callback,
        pass_update_queue=pass_update_queue,
        pass_job_queue=pass_job_queue,
        pass_user_data=pass_user_data,
        pass_chat_data=pass_chat_data,
    )
    if (
        message_updates is False
        and channel_post_updates is False
        and edited_updates is False
    ):
        raise ValueError(
            "message_updates, channel_post_updates and edited_updates are all False"
        )
    if filters is not None:
        self.filters = Filters.update & filters
    else:
        self.filters = Filters.update
    if message_updates is not None:
        warnings.warn(
            "message_updates is deprecated. See https://git.io/fxJuV for more info",
            TelegramDeprecationWarning,
            stacklevel=2,
        )
        if message_updates is False:
            self.filters &= ~Filters.update.message

    if channel_post_updates is not None:
        warnings.warn(
            "channel_post_updates is deprecated. See https://git.io/fxJuV "
            "for more info",
            TelegramDeprecationWarning,
            stacklevel=2,
        )
        if channel_post_updates is False:
            self.filters &= ~Filters.update.channel_post

    if edited_updates is not None:
        warnings.warn(
            "edited_updates is deprecated. See https://git.io/fxJuV for more info",
            TelegramDeprecationWarning,
            stacklevel=2,
        )
        if edited_updates is False:
            self.filters &= ~(
                Filters.update.edited_message | Filters.update.edited_channel_post
            )


# Traceback (telegram.error.BadRequest)
<project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /async_start
2017-06-20 23:24:12,188 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise
Traceback (most recent call last):
File "<project_path>/venv/src/python-telegram-bot/telegram/utils/promise.py", line 42, in run
self._result = self.pooled_function(*self.args, **self.kwargs)
File "<project_path>/issue.py", line 25, in action_async_start
update.message.reply_text(msg, parse_mode=ParseMode.HTML)
File "<project_path>/venv/src/python-telegram-bot/telegram/message.py", line 340, in reply_text
return self.bot.send_message(self.chat_id, *args, **kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/bot.py", line 125, in decorator
result = func(self, *args, **kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/bot.py", line 158, in decorator
return Bot._message_wrapper(self, url, data, *args, **kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/bot.py", line 146, in _message_wrapper
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
File "<project_path>/venv/src/python-telegram-bot/telegram/utils/request.py", line 252, in post
**urlopen_kwargs)
File "<project_path>/venv/src/python-telegram-bot/telegram/utils/request.py", line 194, in _request_wrapper
raise BadRequest(message)
telegram.error.BadRequest: Can't parse entities in message text: unsupported start tag "invalid_tag" at byte offset 0

Process finished with exit code 0

# Fixed code
def __init__(
    self,
    filters,
    callback,
    pass_update_queue=False,
    pass_job_queue=False,
    pass_user_data=False,
    pass_chat_data=False,
    message_updates=None,
    channel_post_updates=None,
    edited_updates=None,
    run_async=False,
):
    super().__init__(
        callback,
        pass_update_queue=pass_update_queue,
        pass_job_queue=pass_job_queue,
        pass_user_data=pass_user_data,
        pass_chat_data=pass_chat_data,
        run_async=run_async,
    )
    if (
        message_updates is False
        and channel_post_updates is False
        and edited_updates is False
    ):
        raise ValueError(
            "message_updates, channel_post_updates and edited_updates are all False"
        )
    if filters is not None:
        self.filters = Filters.update & filters
    else:
        self.filters = Filters.update
    if message_updates is not None:
        warnings.warn(
            "message_updates is deprecated. See https://git.io/fxJuV for more info",
            TelegramDeprecationWarning,
            stacklevel=2,
        )
        if message_updates is False:
            self.filters &= ~Filters.update.message

    if channel_post_updates is not None:
        warnings.warn(
            "channel_post_updates is deprecated. See https://git.io/fxJuV "
            "for more info",
            TelegramDeprecationWarning,
            stacklevel=2,
        )
        if channel_post_updates is False:
            self.filters &= ~Filters.update.channel_post

    if edited_updates is not None:
        warnings.warn(
            "edited_updates is deprecated. See https://git.io/fxJuV for more info",
            TelegramDeprecationWarning,
            stacklevel=2,
        )
        if edited_updates is False:
            self.filters &= ~(
                Filters.update.edited_message | Filters.update.edited_channel_post
            )