class Chat(object):
    def __init__(self, chat_id, title, chat_type):
        self.chat_id = chat_id
        self.title = title
        self.chat_type = chat_type

class Message(object):
    def __init__(self, chat, text):
        self.chat = chat
        self.text = text

class InlineQuery(object):
    def __init__(self, query_id, query):
        self.query_id = query_id
        self.query = query

class TelegramMapper:

    def __init__(self, logger):
        self.logger = logger

    def __is_message(self, json):
        return json.get('message', None) != None

    def __is_inline_query(self, json):
        return json.get('inline_query', None) != None

    def __to_message(self, json):
        raw_message = json['message']
        text = raw_message.get('text', None)
        raw_chat = raw_message.get('chat', None)
        self.logger.info(raw_chat)
        chat = Chat(raw_chat['id'], raw_chat['title'], raw_chat['type']) if raw_chat != None else None
        return Message(chat, text)

    def __to_inline_query(self, json):
        inline_query = json['inline_query']
        query = inline_query['query']
        query_id = inline_query['id']
        return InlineQuery(query_id, query)

    def parse_telegram_object(self, json):
        if self.__is_message(json):
            return self.__to_message(json)
        elif self.__is_inline_query(json):
            return self.__to_inline_query(json)

        return None

@@ -51,16 +51,26 @@
 , title,
+ username,
  chat_ty
@@ -132,16 +132,49 @@
 = title%0A
+        self.username = username%0A
         
@@ -939,16 +939,38 @@
 t%5B'id'%5D,
+ %5C%0A                   
  raw_cha
@@ -974,36 +974,144 @@
 chat
-%5B
+.get(
 'title'
-%5D, raw_chat%5B'type'%5D)
+, None), %5C%0A                    raw_chat.get('username', None), %5C%0A                    raw_chat%5B'type'%5D) %5C%0A                   
  if 

Fix some keyerrors when mapping telegram Chat object