(self)
Handles all messages sent to securitybot.
        Currently only active users are considered, i.e. we don't care if a user
        sends us a message but we haven't sent them anything.
Handles all messages sent to securitybot.
        Currently only active users are considered, i.e. we don't care if a user
        sends us a message but we haven't sent them anything.
Handles all messages sent to securitybot . Currently only active users are considered i . e . we don t care if a user sends us a message but we haven t sent them anything .
def handle_messages(self):
        # type: () -> None
        '''
        Handles all messages sent to securitybot.
        Currently only active users are considered, i.e. we don't care if a user
        sends us a message but we haven't sent them anything.
        '''
        messages = self.chat.get_messages()
        for message in messages:
            user_id = message['user']
            text = message['text']
            user = self.user_lookup(user_id)

            # Parse each received line as a command, otherwise send an error message
            if self.is_command(text):
                self.handle_command(user, text)
            else:
                self.chat.message_user(user, self.messages['bad_command'])
def handle_messages ( self ) : # type: () -> None messages = self . chat . get_messages ( ) for message in messages : user_id = message [ 'user' ] text = message [ 'text' ] user = self . user_lookup ( user_id ) # Parse each received line as a command, otherwise send an error message if self . is_command ( text ) : self . handle_command ( user , text ) else : self . chat . message_user ( user , self . messages [ 'bad_command' ] )