(self)
return [m for m in messages if 'user' in m and m['channel'].startswith('D')]
Gets a list of all new messages received by the bot in direct
        messaging channels. That is, this function ignores all messages
        posted in group chats as the bot never interacts with those.

        Each message should have the following format, minimally:
        {
            "user": The unique ID of the user who sent a message.
            "text": The text of the received message.
        }
Gets a list of all new messages received by the bot in direct
        messaging channels. That is, this function ignores all messages
        posted in group chats as the bot never interacts with those.
Gets a list of all new messages received by the bot in direct messaging channels . That is this function ignores all messages posted in group chats as the bot never interacts with those .
def get_messages(self):
        # type () -> List[Dict[str, Any]]
        '''
        Gets a list of all new messages received by the bot in direct
        messaging channels. That is, this function ignores all messages
        posted in group chats as the bot never interacts with those.

        Each message should have the following format, minimally:
        {
            "user": The unique ID of the user who sent a message.
            "text": The text of the received message.
        }
        '''
        events = self._slack.rtm_read()
        messages = [e for e in events if e['type'] == 'message']
        return [m for m in messages if 'user' in m and m['channel'].startswith('D')]
def get_messages ( self ) : # type () -> List[Dict[str, Any]] events = self . _slack . rtm_read ( ) messages = [ e for e in events if e [ 'type' ] == 'message' ] return [ m for m in messages if 'user' in m and m [ 'channel' ] . startswith ( 'D' ) ]