(self, user, command)
Handles a given command from a user.
Handles a given command from a user.
Handles a given command from a user .
def handle_command(self, user, command):
        # type: (User, str) -> None
        '''
        Handles a given command from a user.
        '''
        key, args = self.parse_command(command)
        logging.info('Handling command {0} for {1}'.format(key, user['name']))
        cmd = self.commands[key]
        if cmd['fn'](self, user, args):
            if cmd['success_msg']:
                self.chat.message_user(user, cmd['success_msg'])
        else:
            if cmd['failure_msg']:
                self.chat.message_user(user, cmd['failure_msg'])
def handle_command ( self , user , command ) : # type: (User, str) -> None key , args = self . parse_command ( command ) logging . info ( 'Handling command {0} for {1}' . format ( key , user [ 'name' ] ) ) cmd = self . commands [ key ] if cmd [ 'fn' ] ( self , user , args ) : if cmd [ 'success_msg' ] : self . chat . message_user ( user , cmd [ 'success_msg' ] ) else : if cmd [ 'failure_msg' ] : self . chat . message_user ( user , cmd [ 'failure_msg' ] )