From 8e95f58948b89256f98ac02ece865a3725040358 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 20 Dec 2018 16:41:06 +0800 Subject: [PATCH] fix bug: midway join confuse the bot --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index e8ac814..493f896 100755 --- a/bot.py +++ b/bot.py @@ -468,7 +468,10 @@ async def new_msg_handler(event): logger.info('Bot: Game started. I\'m the first player.') game.start_game() logger.info('Bot: It\'s my turn.') - if game.is_playing and game.joined and get_peer_id(unochat) in game.joined: + if game.joined and get_peer_id(unochat) in game.joined: + if not game.is_playing: + logger.info('Bot: Game started a long time ago. I joined midway.') + game.start_game() await inline_query() else: logger.info('I\'m not playing in {} - {}'.format(full_info[1].title, get_peer_id(unochat)))