zulip_bots: Make state_handler property of bot_handler.
This commit is contained in:
parent
45c38d0dcf
commit
eb6982e670
25 changed files with 51 additions and 51 deletions
|
@ -274,14 +274,14 @@ class ticTacToeHandler(object):
|
|||
message starts with @mention-bot.
|
||||
'''
|
||||
|
||||
def handle_message(self, message, bot_handler, state_handler):
|
||||
def handle_message(self, message, bot_handler):
|
||||
command_list = message['content']
|
||||
command = ""
|
||||
for val in command_list:
|
||||
command += val
|
||||
original_sender = message['sender_email']
|
||||
|
||||
with state_handler.state({}) as mydict:
|
||||
with bot_handler.state_handler.state({}) as mydict:
|
||||
user_game = mydict.get(original_sender)
|
||||
if (not user_game) and command == "new":
|
||||
user_game = TicTacToeGame(copy.deepcopy(initial_board))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue