key = params[:key].to_s.intern\r
value = params[:value].join(" ")\r
unless @bot.config.items.has_key?(key)\r
- m.reply "no such config key #{key}"\r
- return\r
+ m.reply "no such config key #{key}" unless params[:silent]\r
+ return false\r
end\r
- return if !@bot.auth.allow?(@bot.config.items[key].auth_path, m.source, m.replyto)\r
+ return false if !@bot.auth.allow?(@bot.config.items[key].auth_path, m.source, m.replyto)\r
begin\r
@bot.config.items[key].set_string(value)\r
rescue ArgumentError => e\r
- m.reply "failed to set #{key}: #{e.message}"\r
- return\r
+ m.reply "failed to set #{key}: #{e.message}" unless params[:silent]\r
+ return false\r
end\r
if @bot.config.items[key].requires_restart\r
- m.reply "this config change will take effect on the next restart"\r
+ m.reply "this config change will take effect on the next restart" unless params[:silent]\r
+ return :restart\r
elsif @bot.config.items[key].requires_rescan\r
- m.reply "this config change will take effect on the next rescan"\r
+ m.reply "this config change will take effect on the next rescan" unless params[:silent]\r
+ return :rescan\r
else\r
- m.okay\r
+ m.okay unless params[:silent]\r
+ return true\r
end\r
end\r
\r