From 7aeb2f0fbb49643891d99b4d6118709eb7c62383 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 14 Feb 2012 00:32:31 +0000 Subject: [PATCH] fix unload --- modules/admin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/admin.js b/modules/admin.js index ef0cfc6..03a87f0 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -37,6 +37,8 @@ var adminCommands = function(dbot) { 'unload': function(data, params) { if(dbot.moduleNames.include(params[1])) { + var cacheKey = require.resolve('./modules/' + name); + delete require.cache[cacheKey]; delete dbot.moduleNames[params[1]]; dbot.reloadModules(); dbot.say(data.channel, 'Turned off module: ' + params[1]);