    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'])
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.
securitybot/bot.py