diff --git a/DrBotIRC.py b/DrBotIRC.py index f72f30b..6ee6f4c 100644 --- a/DrBotIRC.py +++ b/DrBotIRC.py @@ -246,6 +246,10 @@ class DrBotIRC(irclib.IRC): print(self.save_config()) sys.exit() + def save_modules(self): + for module in self.modlist: + module.save() + def save_config(self): with open('dr.botzo.cfg', 'w') as cfg: self.config.write(cfg) diff --git a/modules/IrcAdmin.py b/modules/IrcAdmin.py index 78c8c32..00d13f1 100644 --- a/modules/IrcAdmin.py +++ b/modules/IrcAdmin.py @@ -68,6 +68,7 @@ class IrcAdmin(Module): elif whats[0] == '!autojoin' and admin_unlocked and len(whats) >= 3: return self.sub_autojoin_manipulate(connection, event, nick, userhost, what, admin_unlocked) elif whats[0] == '!config' and whats[1] == 'save' and admin_unlocked: + self.irc.save_modules() return self.irc.save_config() elif whats[0] == '!nick' and admin_unlocked and len(whats) >= 2: return self.sub_change_nick(connection, event, nick, userhost, what, admin_unlocked)