IrcAdmin: following the last change to saving, have !save also call a new save_modules()
This commit is contained in:
parent
1e0de47d84
commit
3e533890a1
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue