From a9740613fb724a2ba63b084c926fb553383b8920 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 7 Jul 2017 17:37:41 +0300 Subject: [PATCH] bugfics --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 087423c..ddedf11 100644 --- a/main.py +++ b/main.py @@ -589,7 +589,7 @@ def join(bot, update): game.message(bot, s.error_player_already_joined) return # Giocatore senza username - if 'username' not in update.message.from_user: + if not (hasattr(update.message, "from_user") and 'username' in update.message.from_user): game.message(bot, s.error_no_username) return p = Player(update.message.from_user['id'], update.message.from_user['username']) @@ -627,7 +627,7 @@ def status(bot, update): text = str() if __debug__: text += s.debug_mode - text += s.status_header.format(name=game.name, admin=game.admin.tusername, phase=game.phase) + text += s.status_header.format(name=game.name, admin=game.admin.tusername if game.admin is not None else "-", phase=game.phase) game.updatevotes() # Aggiungi l'elenco dei giocatori for player in game.players: