pcinfoで登録されていないPCを非表示に
This commit is contained in:
parent
a8bf3ab4b7
commit
683be42817
1 changed files with 13 additions and 10 deletions
23
dislocker.py
23
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)
|
||||
|
|
Loading…
Reference in a new issue