mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
fix unload
This commit is contained in:
parent
d5ef51e506
commit
7aeb2f0fbb
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user