3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

fix unload

This commit is contained in:
Luke Slater 2012-02-14 00:32:31 +00:00
parent d5ef51e506
commit 7aeb2f0fbb

View File

@ -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]);