@@ -0,0 +1,1035 @@
+import itertools%0A%0Afrom game.score import ScoreUpdater%0Afrom tools.logger import Logger%0A%0A%0Aclass BotApi:%0A    def __init__(self, bot, score: ScoreUpdater):%0A        self.logger = Logger(bot, %22API%22, reuse_message=False)%0A        self.logger.info(%22Bot API started%22)%0A        self.score = score%0A%0A    def set_score(self, data):%0A        self._log_call(%22set_score%22, data)%0A        try:%0A            auth, score = data.split(%22&%22, 1)%0A            score = int(score)%0A            self.score.set_score(auth, score)%0A        except:%0A            pass%0A%0A    def _log_call(self, name, *args, **kwargs):%0A        log_call(self.logger.debug, name, args, kwargs)%0A%0A%0Aclass DummyApi:%0A    def __getattr__(self, item):%0A        return lambda *args, **kwargs: log_call(print, item, args, kwargs)%0A%0A%0Adef log_call(log_func, call_name, args, kwargs):%0A    call_args = map(repr, args)%0A    call_kwargs = (k + %22=%22 + repr(v) for k, v in kwargs.items())%0A    all_args = %22, %22.join(itertools.chain(call_args, call_kwargs))%0A    log_func(%22%3E%3E Called: %22 + call_name + %22(%22 + all_args + %22)%22)%0A

Create BotApi and DummyApi