From 77db61b02dd8d52969e07a9e8dc91ab7c4e7fbcb Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 14 Feb 2012 00:41:34 +0000 Subject: [PATCH] it's an array not an object... --- modules/admin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/admin.js b/modules/admin.js index dba8d7a..a0db0c4 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -39,7 +39,10 @@ var adminCommands = function(dbot) { if(dbot.moduleNames.include(params[1])) { var cacheKey = require.resolve('../modules/' + params[1]); delete require.cache[cacheKey]; - delete dbot.moduleNames[params[1]]; + + var moduleIndex = dbot.moduleNames.indexOf(params[1]); + dbot.moduleNames.splice(moduleIndex, 1); + dbot.reloadModules(); dbot.say(data.channel, 'Turned off module: ' + params[1]); } else {