<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_chat(self, chat):
 """Parse a chat message."""

        if chat.data['type'] == 'chat':
            if chat.data['player'] in [p.player_name for i, p in self._players()]:
                self._chat.append(chat.data)
        elif chat.data['type'] == 'ladder':
            self._ladder = chat.data['ladder']
        elif chat.data['type'] == 'rating':
            if chat.data['rating'] != 1600:
                self._ratings[chat.data['player']] = chat.data['rating']