use save_config()

This commit is contained in:
Luke Rogers 2013-10-01 23:00:36 +13:00
parent 88304ff795
commit d6ce1ae6b9
2 changed files with 4 additions and 4 deletions

View file

@ -62,7 +62,7 @@ def deluser(inp, bot=None, notice=None):
users.remove(inp[0]) users.remove(inp[0])
removed = 1 removed = 1
notice("{} has been removed from the group {}".format(inp[0], v)) notice("{} has been removed from the group {}".format(inp[0], v))
json.dump(bot.config, open('config', 'w'), sort_keys=True, indent=2) bot.config.save_config()
if specgroup: if specgroup:
if removed == 0: if removed == 0:
notice("{} is not in the group {}".format(inp[0], specgroup)) notice("{} is not in the group {}".format(inp[0], specgroup))
@ -98,7 +98,7 @@ def adduser(inp, bot=None, notice=None):
users.append(user) users.append(user)
notice("{} has been added to the group {}".format(user, targetgroup)) notice("{} has been added to the group {}".format(user, targetgroup))
users.sort() users.sort()
json.dump(bot.config, open('config', 'w'), sort_keys=True, indent=2) bot.config.save_config()
@hook.command("quit", autohelp=False, permissions=["botcontrol"]) @hook.command("quit", autohelp=False, permissions=["botcontrol"])

View file

@ -51,7 +51,7 @@ def ignore(inp, notice=None, bot=None, config=None):
notice("{} has been ignored.".format(target)) notice("{} has been ignored.".format(target))
ignorelist.append(target) ignorelist.append(target)
ignorelist.sort() ignorelist.sort()
json.dump(bot.config, open('config', 'w'), sort_keys=True, indent=2) bot.config.save_config()
return return
@ -65,7 +65,7 @@ def unignore(inp, notice=None, bot=None, config=None):
notice("{} has been unignored.".format(target)) notice("{} has been unignored.".format(target))
ignorelist.remove(target) ignorelist.remove(target)
ignorelist.sort() ignorelist.sort()
json.dump(bot.config, open('config', 'w'), sort_keys=True, indent=2) bot.config.save_config()
else: else:
notice("{} is not ignored.".format(target)) notice("{} is not ignored.".format(target))
return return