🐛 Fix AttributeError in player manager

This commit is contained in:
xtaodada 2024-02-06 12:36:44 +08:00
parent 9defc34147
commit 59e33eb468
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -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(