From 14c4f0732be1a265fe4fd2c5921404f52b4b60bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Tue, 1 Mar 2016 09:43:01 +0100 Subject: [PATCH] show playable cards --- bot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 0acdf10..5ed49da 100644 --- a/bot.py +++ b/bot.py @@ -69,8 +69,10 @@ def reply_to_query(bot, update): if game.choosing_color: choose_color(results) - elif playable: - playable = list(sorted(player.playable_cards())) + else: + playable = player.playable_cards() + if playable: + playable = list(sorted(playable)) if playable is False: not_your_turn(game, results) @@ -231,7 +233,8 @@ def chosen_card(bot, update): gm.leave_game(user) bot.sendMessage(chat_id, text="Player won!") - player_name = game.current_player.user.first_name + player = game.current_player.user + player_name = player.first_name if player.user.username: player_name += ' (@' + player.user.username + ')' bot.sendMessage(chat_id, text="Next player: " + player_name)