errbot
errbot copied to clipboard
document templates and make them foolproof in arg_botcmd
@arg_botcmd('hostname', type=str, template="search")
@arg_botcmd('hostname2', type=str)
def ddog_search(self,message, hostname=None, hostname2=None):
return {'name': hostname,
'hostname2': hostname2}
doesn't work
@arg_botcmd('hostname', type=str)
@arg_botcmd('hostname2', type=str, template="search")
def ddog_search(self,message, hostname=None, hostname2=None):
return {'name': hostname,
'hostname2': hostname2}
works
@arg_botcmd('hostname', type=str, template="search2")
@arg_botcmd('hostname2', type=str, template="search")
def ddog_search(self,message, hostname=None, hostname2=None):
return {'name': hostname,
'hostname2': hostname2}
should throw an error !
Admittedly, this isn't limited to the template parameter alone, but applies to any parameter I believe. The same happens with the unpack_args parameter for example.