예제 #1
0
파일: dyna.py 프로젝트: e4r7hbug/errbot
    def add_simple(self, _, _1):
        simple1 = Command(lambda plugin, msg, args: "yep %s" % type(plugin),
                          name="say_yep")
        simple2 = Command(say_foo)

        self.create_dynamic_plugin("simple with special#", (simple1, simple2),
                                   doc="documented")

        return "added"
예제 #2
0
파일: dyna.py 프로젝트: zulip/errbot
    def add_simple(self, _, _1):
        simple1 = Command(lambda plugin, msg, args: 'yep %s' % type(plugin),
                          name='say_yep')
        simple2 = Command(say_foo)

        self.create_dynamic_plugin('simple with special#', (simple1, simple2),
                                   doc='documented')

        return 'added'
예제 #3
0
파일: dyna.py 프로젝트: zulip/errbot
 def add_saw(self, _, _1):
     re1 = Command(lambda plugin, msg, args: '+'.join(args),
                   name='splitme',
                   cmd_type=botcmd,
                   cmd_kwargs={'split_args_with': ','})
     self.create_dynamic_plugin('saw', (re1, ))
     return 'added'
예제 #4
0
파일: dyna.py 프로젝트: zulip/errbot
 def add_re(self, _, _1):
     re1 = Command(lambda plugin, msg, match: 'fffound',
                   name='ffound',
                   cmd_type=botmatch,
                   cmd_args=(r'^.*cheese.*$', ))
     self.create_dynamic_plugin('re', (re1, ))
     return 'added'
예제 #5
0
파일: dyna.py 프로젝트: e4r7hbug/errbot
 def add_saw(self, _, _1):
     re1 = Command(
         lambda plugin, msg, args: "+".join(args),
         name="splitme",
         cmd_type=botcmd,
         cmd_kwargs={"split_args_with": ","},
     )
     self.create_dynamic_plugin("saw", (re1, ))
     return "added"
예제 #6
0
파일: dyna.py 프로젝트: e4r7hbug/errbot
 def add_re(self, _, _1):
     re1 = Command(
         lambda plugin, msg, match: "fffound",
         name="ffound",
         cmd_type=botmatch,
         cmd_args=(r"^.*cheese.*$", ),
     )
     self.create_dynamic_plugin("re", (re1, ))
     return "added"
예제 #7
0
    def add_arg(self, _, _1):
        cmd1_name = 'echo_to_me'
        cmd1 = Command(lambda plugin, msg, args: 'string to echo is %s' % args.
                       positional_arg,
                       cmd_type=arg_botcmd,
                       cmd_args=('positional_arg', ),
                       cmd_kwargs={
                           'unpack_args': False,
                           'name': cmd1_name
                       },
                       name=cmd1_name)

        self.create_dynamic_plugin('arg', (cmd1, ), doc='documented')

        return 'added'
예제 #8
0
파일: dyna.py 프로젝트: e4r7hbug/errbot
    def add_arg(self, _, _1):
        cmd1_name = "echo_to_me"
        cmd1 = Command(
            lambda plugin, msg, args: "string to echo is %s" % args.
            positional_arg,
            cmd_type=arg_botcmd,
            cmd_args=("positional_arg", ),
            cmd_kwargs={
                "unpack_args": False,
                "name": cmd1_name
            },
            name=cmd1_name,
        )

        self.create_dynamic_plugin("arg", (cmd1, ), doc="documented")

        return "added"
예제 #9
0
파일: dyna.py 프로젝트: zulip/errbot
 def add_clashing(self, _, _1):
     simple1 = Command(lambda plugin, msg, args: 'dynamic', name='clash')
     self.create_dynamic_plugin('clashing', (simple1, ))
     return 'added'
예제 #10
0
파일: dyna.py 프로젝트: e4r7hbug/errbot
 def add_clashing(self, _, _1):
     simple1 = Command(lambda plugin, msg, args: "dynamic", name="clash")
     self.create_dynamic_plugin("clashing", (simple1, ))
     return "added"