add 'meta.internal_only' option, defaulting to true
this allows for better control on recursion/alias type things, which is an awful lot of what the bot does these days
This commit is contained in:
		
							parent
							
								
									bda1eb9560
								
							
						
					
					
						commit
						d18b2e49ff
					
				
							
								
								
									
										18
									
								
								Module.py
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Module.py
									
									
									
									
									
								
							| @ -117,6 +117,15 @@ class Module(object): | ||||
|         addressed_pattern = '^' + connection.get_nickname() + '[:,]?\s+' | ||||
|         addressed_re = re.compile(addressed_pattern) | ||||
| 
 | ||||
|         # see if we should just skip msg stuff entirely (common for stuff run via alias) | ||||
|         internal_only = True | ||||
|         try: | ||||
|             internal_only = self.config.getboolean(self.__class__.__name__, 'meta.internal_only') | ||||
|         except NoOptionError: pass | ||||
|         except NoSectionError: pass | ||||
|         if internal_only and replypath is not None: | ||||
|             return | ||||
| 
 | ||||
|         need_prefix = True | ||||
|         try: | ||||
|             need_prefix = self.config.getboolean(self.__class__.__name__, 'meta.pubmsg_needs_bot_prefix') | ||||
| @ -174,6 +183,15 @@ class Module(object): | ||||
|                 admin_unlocked = True | ||||
|         except NoOptionError: pass | ||||
| 
 | ||||
|         # see if we should just skip msg stuff entirely (common for stuff run via alias) | ||||
|         internal_only = True | ||||
|         try: | ||||
|             internal_only = self.config.getboolean(self.__class__.__name__, 'meta.internal_only') | ||||
|         except NoOptionError: pass | ||||
|         except NoSectionError: pass | ||||
|         if internal_only and replypath is not None: | ||||
|             return | ||||
| 
 | ||||
|         if replypath is not None: | ||||
|             what = self.try_recursion(connection, event, nick, userhost, replypath, what, admin_unlocked) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user