create decorator for plugin creation (thanks @datagrok)

This commit is contained in:
Mallory Hancock 2017-09-27 16:54:08 -07:00
parent eea3302542
commit 87332c1ac4

View File

@ -17,3 +17,10 @@ def message(msg):
def add_plugin(command, func): def add_plugin(command, func):
cmds.append({'cmd': command, 'func': 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