1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
from __future__ import absolute_import
from errbot import BotPlugin, arg_botcmd, botcmd, re_botcmd
class Test(BotPlugin):
@botcmd
def test_template1(self, msg, args):
self.send_templated(msg.frm, "test", {"variable": "ok"})
@botcmd(template="test")
def test_template2(self, msg, args):
return {"variable": "ok"}
@botcmd(template="test")
def test_template3(self, msg, args):
yield {"variable": "ok"}
@arg_botcmd("my_var", type=str, template="test")
def test_template4(self, msg, my_var=None):
return {"variable": my_var}
|