show playable cards
This commit is contained in:
parent
63a2a4ca81
commit
14c4f0732b
1 changed files with 6 additions and 3 deletions
9
bot.py
9
bot.py
|
@ -69,8 +69,10 @@ def reply_to_query(bot, update):
|
||||||
|
|
||||||
if game.choosing_color:
|
if game.choosing_color:
|
||||||
choose_color(results)
|
choose_color(results)
|
||||||
elif playable:
|
else:
|
||||||
playable = list(sorted(player.playable_cards()))
|
playable = player.playable_cards()
|
||||||
|
if playable:
|
||||||
|
playable = list(sorted(playable))
|
||||||
|
|
||||||
if playable is False:
|
if playable is False:
|
||||||
not_your_turn(game, results)
|
not_your_turn(game, results)
|
||||||
|
@ -231,7 +233,8 @@ def chosen_card(bot, update):
|
||||||
gm.leave_game(user)
|
gm.leave_game(user)
|
||||||
bot.sendMessage(chat_id, text="Player won!")
|
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:
|
if player.user.username:
|
||||||
player_name += ' (@' + player.user.username + ')'
|
player_name += ' (@' + player.user.username + ')'
|
||||||
bot.sendMessage(chat_id, text="Next player: " + player_name)
|
bot.sendMessage(chat_id, text="Next player: " + player_name)
|
||||||
|
|
Loading…
Reference in a new issue