From 683be4281757e17ed5ae12aef28812b984dfd972 Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Sat, 5 Oct 2024 10:30:23 +0900 Subject: [PATCH] =?UTF-8?q?pcinfo=E3=81=A7=E7=99=BB=E9=8C=B2=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84PC=E3=82=92?= =?UTF-8?q?=E9=9D=9E=E8=A1=A8=E7=A4=BA=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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)