mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
relay_clientbot: allow overriding clientbot styles by network
Closes #455.
This commit is contained in:
parent
b1248524a9
commit
0ae7eb2563
@ -14,7 +14,9 @@ a:
|
|||||||
|
|
||||||
### Custom Clientbot Styles
|
### 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::<event name>`. 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::<event name>`. As of 2.0-alpha4, you can also set this per-network by defining options in the form `servers::<network name>::relay_clientbot_styles::<event names>` (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).
|
A common use case for this feature is to turn off or adjust colors/formatting; this is explicitly documented [below](#disabling-colorscontrol-codes).
|
||||||
|
|
||||||
|
@ -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
|
# 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
|
# key, falling back to one defined in default_styles above, and then nothing if not found
|
||||||
# there.
|
# there.
|
||||||
text_template = (relay_conf.get('clientbot_styles') or {}).get(real_command,
|
text_template = irc.get_service_option('relay', 'clientbot_styles', {}).get(
|
||||||
default_styles.get(real_command, ''))
|
real_command, default_styles.get(real_command, ''))
|
||||||
text_template = string.Template(text_template)
|
text_template = string.Template(text_template)
|
||||||
|
|
||||||
if text_template:
|
if text_template:
|
||||||
|
Loading…
Reference in New Issue
Block a user