zulip_bots: Make state_handler property of bot_handler.

This commit is contained in:
derAnfaenger 2017-10-23 12:17:46 +02:00
parent 45c38d0dcf
commit eb6982e670
25 changed files with 51 additions and 51 deletions

View file

@ -11,8 +11,8 @@ class IncrementorHandler(object):
is @-mentioned, this number will be incremented in the same message.
'''
def handle_message(self, message, bot_handler, state_handler):
with state_handler.state({'number': 0, 'message_id': None}) as state:
def handle_message(self, message, bot_handler):
with bot_handler.state_handler.state({'number': 0, 'message_id': None}) as state:
state['number'] += 1
if state['message_id'] is None:
result = bot_handler.send_reply(message, str(state['number']))