mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 08:57:25 +01:00 
			
		
		
		
	relay: use get_service_options() to combine clientbot styles options (#642)
This commit is contained in:
		
							parent
							
								
									e0d82cdf3d
								
							
						
					
					
						commit
						1623462b73
					
				@ -14,9 +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::<event name>`. As of 2.0-beta1, 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).
 | 
			
		||||
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 PyLink 2.1, you can also override options per network by defining them in the form `servers::<network name>::relay_clientbot_styles::<event names>`
 | 
			
		||||
 | 
			
		||||
See below for a list of supported events and their default values (as of 2.0-beta1).
 | 
			
		||||
See below for a list of supported events and their default values (as of PyLink 2.1).
 | 
			
		||||
 | 
			
		||||
A common use case for this feature is to turn off or adjust colors/formatting; this is explicitly documented [below](#disabling-colorscontrol-codes).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -87,7 +87,7 @@ 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 = irc.get_service_option('relay', 'clientbot_styles', {}).get(
 | 
			
		||||
        text_template = irc.get_service_options('relay', 'clientbot_styles', dict).get(
 | 
			
		||||
                            real_command, default_styles.get(real_command, ''))
 | 
			
		||||
        text_template = string.Template(text_template)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user