diff --git a/docs/advanced-relay-config.md b/docs/advanced-relay-config.md index a60fa16..2d85cf0 100644 --- a/docs/advanced-relay-config.md +++ b/docs/advanced-relay-config.md @@ -14,7 +14,9 @@ a: ### Custom Clientbot Styles -Custom Clientbot styles can be applied for any of Clientbot's supported events, by defining keys in the format `relay::clientbot_styles::`. See below for a list of supported events and their default values (as of 1.3.0). +Custom Clientbot styles can be applied for any of Clientbot's supported events, by defining keys in the format `relay::clientbot_styles::`. As of 2.0-alpha4, you can also set this per-network by defining options in the form `servers::::relay_clientbot_styles::` (Note: defining Clientbot styles locally will override the global `clientbot_styles` block and cause all values under it to be ignored for that network). + +See below for a list of supported events and their default values (as of 1.3.0). A common use case for this feature is to turn off or adjust colors/formatting; this is explicitly documented [below](#disabling-colorscontrol-codes). diff --git a/plugins/relay_clientbot.py b/plugins/relay_clientbot.py index a102677..de1bf17 100644 --- a/plugins/relay_clientbot.py +++ b/plugins/relay_clientbot.py @@ -80,8 +80,8 @@ def cb_relay_core(irc, source, command, args): # Try to fetch the format for the given command from the relay:clientbot_styles:$command # key, falling back to one defined in default_styles above, and then nothing if not found # there. - text_template = (relay_conf.get('clientbot_styles') or {}).get(real_command, - default_styles.get(real_command, '')) + text_template = irc.get_service_option('relay', 'clientbot_styles', {}).get( + real_command, default_styles.get(real_command, '')) text_template = string.Template(text_template) if text_template: