diff --git a/run.js b/run.js index 3d13cd2..7a523aa 100644 --- a/run.js +++ b/run.js @@ -56,12 +56,12 @@ DBot.prototype.reloadModules = function() { this.save(); var path = require.resolve('./snippets'); - require.cache[path] = undefined; + delete require.cache[path]; require('./snippets'); this.moduleNames.each(function(name) { var cacheKey = require.resolve('./modules/' + name); - require.cache[cacheKey] = undefined; // TODO: snippet to remove element properly + delete require.cache[cacheKey]; try { this.rawModules.push(require('./modules/' + name)); } catch(err) {