create decorator for plugin creation (thanks @datagrok)
This commit is contained in:
		
							parent
							
								
									eea3302542
								
							
						
					
					
						commit
						87332c1ac4
					
				@ -17,3 +17,10 @@ def message(msg):
 | 
			
		||||
def add_plugin(command, func):
 | 
			
		||||
    cmds.append({'cmd': command, 'func': func})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def register(command):
 | 
			
		||||
    def register_for_command(func):
 | 
			
		||||
        add_plugin(command, func)
 | 
			
		||||
        return func
 | 
			
		||||
    return register_for_command
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user