DrBotIRC: add support for ignoring all events from a nick
rudimentary for the moment. pop something like this in your config: [Ignore] nick_to_ignore = 1
This commit is contained in:
		
							parent
							
								
									26bc8bec34
								
							
						
					
					
						commit
						ef9b80d86f
					
				
							
								
								
									
										13
									
								
								DrBotIRC.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								DrBotIRC.py
									
									
									
									
									
								
							| @ -104,6 +104,19 @@ class DrBotIRC(irclib.IRC): | ||||
|     def _handle_event(self, connection, event): | ||||
|         """Override event handler to do recursion.""" | ||||
| 
 | ||||
|         try: | ||||
|             nick = irclib.nm_to_n(event.source()) | ||||
|         except (IndexError, AttributeError): | ||||
|             nick = '' | ||||
| 
 | ||||
|         try: | ||||
|             if self.config.has_section('Ignore'): | ||||
|                 alias = self.config.get('Ignore', nick) | ||||
|                 if alias: | ||||
|                     print("ignoring " + nick + " as per config file") | ||||
|                     return | ||||
|         except NoOptionError: pass | ||||
| 
 | ||||
|         self.try_alias_cmds(connection, event) | ||||
|         self.try_recursion(connection, event) | ||||
|         self.try_alias(connection, event) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user