def private_bot(protocol): return RequestBot( protocol=protocol, user=User('socek!a@b'), private=True, config={}, temp={}, )
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={}, )
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)
def bot_with_importer(protocol_with_importer): return RequestBot( protocol=protocol_with_importer, user=User('socek!a@b'), chan='#czarnobyl', )
def test_init(protocol): bot = RequestBot(protocol) assert bot.protocol is protocol
def make_bot(protocol, **kwargs): return RequestBot(protocol, user=User('socek!a@b'), chan='#czarnobyl', **kwargs)