# Buggy code
async def _parse_message(self, response):
    """Handle logic to parse a received message.

    Since everyone can send a private message to any user/bot
    in Telegram, this method allows to set a list of whitelisted
    users that can interact with the bot. If any other user tries
    to interact with the bot the command is not parsed and instead
    the bot will inform that user that he is not allowed to talk
    with the bot.

    We also set self.latest_update to +1 in order to get the next
    available message (or an empty {} if no message has been received
    yet) with the method self._get_messages().

    Args:
        response (dict): Response returned by aiohttp.ClientSession.

    """
    for result in response["result"]:
        _LOGGER.debug(result)
        if result["message"]["text"]:
            user = result["message"]["from"]["username"]

            message = Message(
                user, result["message"]["chat"], self, result["message"]["text"]
            )

            if not self.whitelisted_users or user in self.whitelisted_users:
                await self.opsdroid.parse(message)
            else:
                message.text = "Sorry, you're not allowed to speak with this bot."
                await self.respond(message)
            self.latest_update = result["update_id"] + 1


# Traceback (KeyError)
DEBUG opsdroid.connector.telegram: {'update_id': 539000683, 'channel_post': {'message_id': 15, 'chat': {'id': -1002528219498, 'title': 'vLab', 'type': 'channel'}, 'date': 1550000742, 'text': 'hi'}}
DEBUG opsdroid.connector.telegram: {'update_id': 539026984, 'message': {'message_id': 53, 'from': {'id': 452280388, 'is_bot': False, 'first_name': 'IOBreaker', 'language_code': 'en'}, 'chat': {'id': 452266388, 'first_name': 'IOBreaker', 'type': 'private'}, 'date': 1550000813, 'text': '/start', 'entities': [{'offset': 0, 'length': 6, 'type': 'bot_command'}]}}
DEBUG asyncio: Using selector: EpollSelector
Traceback (most recent call last):
File "/usr/bin/opsdroid", line 11, in <module>
load_entry_point('opsdroid==0.14.1', 'console_scripts', 'opsdroid')()
File "/usr/lib64/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib64/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib64/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib64/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/opsdroid/__main__.py", line 197, in main
opsdroid.run()
File "/usr/lib/python3.6/site-packages/opsdroid/core.py", line 135, in run
self.eventloop.run_until_complete(asyncio.gather(*pending))
File "/usr/lib64/python3.6/asyncio/base_events.py", line 473, in run_until_complete
return future.result()
File "/usr/lib/python3.6/site-packages/opsdroid/connector/telegram/__init__.py", line 163, in listen
await self._get_messages()
File "/usr/lib/python3.6/site-packages/opsdroid/connector/telegram/__init__.py", line 143, in _get_messages
await self._parse_message(json)
File "/usr/lib/python3.6/site-packages/opsdroid/connector/telegram/__init__.py", line 99, in _parse_message
user = result["message"]["from"]["username"]
KeyError: 'username'

# Fixed code
async def _parse_message(self, response):
    """Handle logic to parse a received message.

    Since everyone can send a private message to any user/bot
    in Telegram, this method allows to set a list of whitelisted
    users that can interact with the bot. If any other user tries
    to interact with the bot the command is not parsed and instead
    the bot will inform that user that he is not allowed to talk
    with the bot.

    We also set self.latest_update to +1 in order to get the next
    available message (or an empty {} if no message has been received
    yet) with the method self._get_messages().

    Args:
        response (dict): Response returned by aiohttp.ClientSession.

    """
    for result in response["result"]:
        _LOGGER.debug(result)
        if "channel" in result["message"]["chat"]["type"]:
            _LOGGER.debug("Channel message parsing not supported - Ignoring message")
        elif "message" in result and "text" in result["message"]:
            user = self.get_user(result)
            message = Message(
                user, result["message"]["chat"], self, result["message"]["text"]
            )

            if self.handle_user_permission(result, user):
                await self.opsdroid.parse(message)
            else:
                message.text = "Sorry, you're not allowed to speak with this bot."
                await self.respond(message)
            self.latest_update = result["update_id"] + 1
        else:
            _LOGGER.error("Unable to parse the message.")