From b6f156327d341bc696a09e118429575f688108be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Tue, 1 Mar 2016 03:15:07 +0100 Subject: [PATCH] include username in status message to notify player, if available --- bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 08fde71..df52490 100644 --- a/bot.py +++ b/bot.py @@ -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):