From e5576388ddcf6dbb6d6de471ff4e378ac5a405d2 Mon Sep 17 00:00:00 2001 From: derAnfaenger Date: Tue, 31 Oct 2017 12:24:10 +0100 Subject: [PATCH] botserver: Remove obsolete state_handler param from handle_message(). --- zulip_botserver/tests/test_server.py | 2 +- zulip_botserver/zulip_botserver/server.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/zulip_botserver/tests/test_server.py b/zulip_botserver/tests/test_server.py index fe5dc08..6bf78ba 100644 --- a/zulip_botserver/tests/test_server.py +++ b/zulip_botserver/tests/test_server.py @@ -6,7 +6,7 @@ from .server_test_lib import BotServerTestCase class BotServerTests(BotServerTestCase): class MockMessageHandler(object): - def handle_message(self, message, bot_handler, state_handler): + def handle_message(self, message, bot_handler): # type: (Any, Any, Any) -> None assert message == {'key': "test message"} diff --git a/zulip_botserver/zulip_botserver/server.py b/zulip_botserver/zulip_botserver/server.py index 2fbaa5c..c432368 100644 --- a/zulip_botserver/zulip_botserver/server.py +++ b/zulip_botserver/zulip_botserver/server.py @@ -74,13 +74,9 @@ def handle_bot(bot): message_handler = lib_module.handler_class() - # TODO: Handle stateful bots properly. - state_handler = StateHandler() - event = request.get_json(force=True) message_handler.handle_message(message=event["message"], - bot_handler=restricted_client, - state_handler=state_handler) + bot_handler=restricted_client) return json.dumps("") def parse_args():