Kicked out of games once he win

This commit is contained in:
imlonghao 2016-04-29 00:17:14 +08:00
parent 9487fdf7f6
commit 971fe8ef88
No known key found for this signature in database
GPG key ID: 12D09AA0058BCBA0

3
bot.py
View file

@ -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)