diff --git a/modules/admin/admin.js b/modules/admin/admin.js index 173e270..99e8a2e 100644 --- a/modules/admin/admin.js +++ b/modules/admin/admin.js @@ -80,7 +80,8 @@ var admin = function(dbot) { 'unload': function(event) { var moduleName = event.params[1]; if(dbot.moduleNames.include(moduleName)) { - var cacheKey = require.resolve('../modules/' + moduleName); + var moduleDir = '../' + moduleName + '/'; + var cacheKey = require.resolve(moduleDir + moduleName); delete require.cache[cacheKey]; var moduleIndex = dbot.moduleNames.indexOf(moduleName);