From 971fe8ef88e6d98f8ddd0123032ee736bb26f6c5 Mon Sep 17 00:00:00 2001 From: imlonghao Date: Fri, 29 Apr 2016 00:17:14 +0800 Subject: [PATCH] Kicked out of games once he win --- bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index d43f6f5..bcbc228 100644 --- a/bot.py +++ b/bot.py @@ -586,7 +586,8 @@ def do_play_card(bot, chat_id, game, player, result_id, user): send_async(bot, chat_id, text="UNO!") if len(player.cards) == 0: send_async(bot, chat_id, text="%s won!" % user.first_name) - if len(game.players) < 3: + gm.leave_game(user, chat_id) + if len(game.players) < 2: send_async(bot, chat_id, text="Game ended!") gm.end_game(chat_id, user)