def METHOD_NAME(self, chatView, text):
    if hasattr(self, "player") or self.gamemodel.examined:
        if text.startswith("# "):
            text = text[2:]
            self.gamemodel.connection.cm.whisper(text)
        elif text.startswith("whisper "):
            text = text[8:]
            self.gamemodel.connection.cm.whisper(text)
        else:
            if not hasattr(self, "player"):
                if (
                    self.gamemodel.players[0].name
                    == self.gamemodel.connection.username
                ):
                    self.player = self.gamemodel.players[0]
                    self.opplayer = self.gamemodel.players[1]
                else:
                    self.player = self.gamemodel.players[1]
                    self.opplayer = self.gamemodel.players[0]
            if self.gamemodel.examined:
                self.opplayer.putMessage(text)
            else:
                self.player.sendMessage(text)
            self.chatView.addMessage(repr(self.player), text)
    else:
        self.gamemodel.connection.cm.whisper(text)