| 1 |
from __future__ import absolute_import |
| 2 |
|
| 3 |
from errbot import BotPlugin, arg_botcmd, botcmd, re_botcmd |
| 4 |
|
| 5 |
|
| 6 |
class Test(BotPlugin): |
| 7 |
"""Just a test plugin to see if _err_botcmd_syntax is consistent on all types of botcmd""" |
| 8 |
|
| 9 |
@botcmd # no syntax |
| 10 |
def foo_nosyntax(self, msg, args): |
| 11 |
pass |
| 12 |
|
| 13 |
@botcmd(syntax="[optional] <mandatory>") |
| 14 |
def foo(self, msg, args): |
| 15 |
pass |
| 16 |
|
| 17 |
@re_botcmd(pattern=r".*") |
| 18 |
def re_foo(self, msg, match): |
| 19 |
pass |
| 20 |
|
| 21 |
@arg_botcmd("value", type=str) |
| 22 |
@arg_botcmd("--repeat-count", dest="repeat", type=int, default=2) |
| 23 |
def arg_foo(self, msg, value=None, repeat=None): |
| 24 |
return value * repeat |