From ae0411ff258b7e766348d827f72b74568128c164 Mon Sep 17 00:00:00 2001 From: yago Date: Thu, 1 Jan 2015 13:54:43 +0100 Subject: [PATCH] save config on plugin enabled / disabled --- bot/bot.lua | 2 +- plugins/plugins.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/bot.lua b/bot/bot.lua index 0f39ac2..7cdefc7 100644 --- a/bot/bot.lua +++ b/bot/bot.lua @@ -83,7 +83,7 @@ function do_action(msg) for name, desc in pairs(plugins) do -- print("Trying module", name) for k, pattern in pairs(desc.patterns) do - print("Trying", text, "against", pattern) + -- print("Trying", text, "against", pattern) matches = { string.match(text, pattern) } if matches[1] then print(" matches",pattern) diff --git a/plugins/plugins.lua b/plugins/plugins.lua index d656824..157f434 100644 --- a/plugins/plugins.lua +++ b/plugins/plugins.lua @@ -7,6 +7,7 @@ function enable_plugin( filename ) if plugin_exists(filename) then -- Add to the config table table.insert(_config.enabled_plugins, filename) + save_config() -- Reload the plugins return reload_plugins( ) else @@ -26,6 +27,7 @@ function disable_plugin( name ) end -- Disable and reload table.remove(_config.enabled_plugins, k) + save_config( ) return reload_plugins(true) end