diff --git a/dislocker.py b/dislocker.py index d4c3c42..7d5e140 100644 --- a/dislocker.py +++ b/dislocker.py @@ -1633,18 +1633,21 @@ async def pcinfo(interaction: discord.Interaction): for i in pc_list['output_dict'].keys(): current_pc_list = pc_list['output_dict'][i] - if current_pc_list['alt_name'] == None: - pc_name_title = f'{current_pc_list['pc_number']} 番' + if current_pc_list['pc_token'] == None: + pass else: - pc_name_title = f'{current_pc_list['pc_number']} 番 ({current_pc_list['alt_name']})' - - if current_pc_list['using_member_id'] == None: - pc_using_value = f'未使用' - else: - discord_user_id = dislocker.get_discord_user_id(member_id=current_pc_list['using_member_id'])['discord_user_id'] - pc_using_value = f'<@{discord_user_id}> が使用中' + if current_pc_list['alt_name'] == None: + pc_name_title = f'{current_pc_list['pc_number']} 番' + else: + pc_name_title = f'{current_pc_list['pc_number']} 番 ({current_pc_list['alt_name']})' + + if current_pc_list['using_member_id'] == None: + pc_using_value = f'未使用' + else: + discord_user_id = dislocker.get_discord_user_id(member_id=current_pc_list['using_member_id'])['discord_user_id'] + pc_using_value = f'<@{discord_user_id}> が使用中' - result_embed.add_field(name=f'{pc_name_title}', value=f'{pc_using_value}') + result_embed.add_field(name=f'{pc_name_title}', value=f'{pc_using_value}') else: result_embed = discord.Embed(title=":x: 操作に失敗しました。", description=f'サーバーでエラーが発生しています。', color=0xC91111)