From 59e33eb468d3d085d31eae6676ea7ad89d73acef Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 6 Feb 2024 12:36:44 +0800 Subject: [PATCH] :bug: Fix AttributeError in player manager --- plugins/account/players.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/account/players.py b/plugins/account/players.py index 5c640d4..0f7facb 100644 --- a/plugins/account/players.py +++ b/plugins/account/players.py @@ -62,8 +62,11 @@ class PlayersManagesPlugin(Plugin): return buttons = [] for player in players: + nickname = "未知" player_info = await self.player_info_service.get(player) - text = f"{player.player_id} {player_info.nickname}" + if player_info: + nickname = player_info.nickname + text = f"{player.player_id} {nickname}" buttons.append( [ InlineKeyboardButton(