mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 19:52:36 +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