Debian Codegraph @

tests/template_plugin/test.py

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