Show the full result of a !config change

This commit is contained in:
jesopo 2019-04-28 10:50:19 +01:00
parent 347253249e
commit 24716402ec

View file

@ -229,7 +229,7 @@ class Module(ModuleManager.BaseModule):
validated_value = validation(value) validated_value = validation(value)
if not validated_value == None: if not validated_value == None:
target.set_setting(setting, validated_value) target.set_setting(setting, validated_value)
return ConfigResult(ConfigResults.Changed) return ConfigResult(ConfigResults.Changed, validated_value)
else: else:
raise ConfigInvalidValue() raise ConfigInvalidValue()
else: else:
@ -311,7 +311,8 @@ class Module(ModuleManager.BaseModule):
raise utils.EventError("Setting not set") raise utils.EventError("Setting not set")
if result.result == ConfigResults.Changed: if result.result == ConfigResults.Changed:
event["stdout"].write("Config changed") event["stdout"].write("Config '%s' set to %s" %
(setting, result.data))
elif result.result == ConfigResults.Retrieved: elif result.result == ConfigResults.Retrieved:
event["stdout"].write("%s: %s" % (setting, result.data)) event["stdout"].write("%s: %s" % (setting, result.data))
elif result.result == ConfigResults.Removed: elif result.result == ConfigResults.Removed: