Merge pull request #3 from imlonghao/patch
Kicked out of games once he win
This commit is contained in:
commit
6a0f3cd8c5
1 changed files with 2 additions and 1 deletions
3
bot.py
3
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!")
|
send_async(bot, chat_id, text="UNO!")
|
||||||
if len(player.cards) == 0:
|
if len(player.cards) == 0:
|
||||||
send_async(bot, chat_id, text="%s won!" % user.first_name)
|
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!")
|
send_async(bot, chat_id, text="Game ended!")
|
||||||
gm.end_game(chat_id, user)
|
gm.end_game(chat_id, user)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue