Example #1
0
def private_bot(protocol):
    return RequestBot(
        protocol=protocol,
        user=User('socek!a@b'),
        private=True,
        config={},
        temp={},
    )
Example #2
0
def public_bot_with_db(protocol_with_db):
    return RequestBot(
        protocol=protocol_with_db,
        user=User('socek!a@b'),
        chan='#czarnobyl',
        private=False,
        config={},
        temp={},
    )
Example #3
0
    def execute_func(self, func, plugin, private, channel, user, args, kwargs):
        if func.block and self.is_blocked(user):
            return  # filtr antyspamowy, nienawidze was

        bot = RequestBot(protocol=self.protocol,
                         private=private,
                         chan=channel if not private else None,
                         config=self.get_plugin_cfg(plugin.name),
                         plugin=plugin,
                         user=user,
                         temp=plugin.temp)

        try:
            dict_arg = check_type(args, kwargs, func)
        except Exception as e:
            traceback.print_exc(file=sys.stdout)
            return

        yield from self._execute_func(func, bot, dict_arg, user, channel)
Example #4
0
def bot_with_importer(protocol_with_importer):
    return RequestBot(
        protocol=protocol_with_importer,
        user=User('socek!a@b'),
        chan='#czarnobyl',
    )
Example #5
0
def test_init(protocol):
    bot = RequestBot(protocol)
    assert bot.protocol is protocol
Example #6
0
def make_bot(protocol, **kwargs):
    return RequestBot(protocol, user=User('socek!a@b'), chan='#czarnobyl', **kwargs)