include username in status message to notify player, if available

This commit is contained in:
Jannes Höke 2016-03-01 03:15:07 +01:00
parent 2dedb16cb8
commit b6f156327d

7
bot.py
View file

@ -231,9 +231,10 @@ def chosen_card(bot, update):
gm.leave_game(user)
bot.sendMessage(chat_id, text="Player won!")
bot.sendMessage(chat_id,
text="Next player: " +
game.current_player.user.first_name)
player_name = player.user.first_name
if player.user.username:
player_name += ' (' + player.user.username + ')'
bot.sendMessage(chat_id, text="Next player: " + player_name)
def error(bot, update, error):