mirror of
				https://github.com/reality/dbot.git
				synced 2025-11-04 08:27:35 +01:00 
			
		
		
		
	Move onDestroy to the right place
This commit is contained in:
		
							parent
							
								
									0f0e935c36
								
							
						
					
					
						commit
						1621e22ddd
					
				@ -12,7 +12,6 @@ var webInterface = function(dbot) {
 | 
			
		||||
 | 
			
		||||
    app.get('/', function(req, res) {
 | 
			
		||||
        res.render('index', { });
 | 
			
		||||
        console.log('test');
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    app.listen(1337);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								run.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								run.js
									
									
									
									
									
								
							@ -30,6 +30,12 @@ DBot.prototype.save = function() {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DBot.prototype.reloadModules = function() {
 | 
			
		||||
    this.modules.each(function(module) {
 | 
			
		||||
        if(module.onDestroy) {
 | 
			
		||||
            module.onDestroy();
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    this.rawModules = [];
 | 
			
		||||
    this.modules = [];
 | 
			
		||||
    this.commands = {};
 | 
			
		||||
@ -39,12 +45,6 @@ DBot.prototype.reloadModules = function() {
 | 
			
		||||
    require.cache[path] = undefined;
 | 
			
		||||
    require('./snippets');
 | 
			
		||||
 | 
			
		||||
    this.modules.each(function(module) {
 | 
			
		||||
        if(module.onDestroy) {
 | 
			
		||||
            module.onDestroy();
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    this.moduleNames.each(function(name) {
 | 
			
		||||
        var cacheKey = require.resolve('./modules/' + name);
 | 
			
		||||
        require.cache[cacheKey] = undefined; // TODO: snippet to remove element properly
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user