mirror of
https://github.com/reality/dbot.git
synced 2025-02-17 14:01:04 +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) {
|
'unload': function(data, params) {
|
||||||
if(dbot.moduleNames.include(params[1])) {
|
if(dbot.moduleNames.include(params[1])) {
|
||||||
|
var cacheKey = require.resolve('./modules/' + name);
|
||||||
|
delete require.cache[cacheKey];
|
||||||
delete dbot.moduleNames[params[1]];
|
delete dbot.moduleNames[params[1]];
|
||||||
dbot.reloadModules();
|
dbot.reloadModules();
|
||||||
dbot.say(data.channel, 'Turned off module: ' + params[1]);
|
dbot.say(data.channel, 'Turned off module: ' + params[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user