def METHOD_NAME(self, chat_id, cached=True):
    if cached and chat_id in self._cache:
        history = self._cache[chat_id]
    else:
        history = self._get_chat_history(chat_id)
        self._cache[chat_id] = history
    history = self._apply_hiding(chat_id, history)
    return history