From bc35550693d4f7ac26f8c9e07ae9dbc9ee64f010 Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Sat, 5 Oct 2024 09:55:12 +0900 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=8C=B2=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=84PC=E3=81=AE=E3=83=9C=E3=82=BF?= =?UTF-8?q?=E3=83=B3=E3=81=AF=E9=80=81=E4=BF=A1=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dislocker.py b/dislocker.py index 71a0aac..c2ca9c7 100644 --- a/dislocker.py +++ b/dislocker.py @@ -1587,10 +1587,14 @@ async def button_init(interaction: discord.Interaction, text_channel: discord.Te pc_button_view = discord.ui.View(timeout=None) for i in pc_list["output_dict"].keys(): current_pc_list = pc_list['output_dict'][i] - if current_pc_list['alt_name'] == None: - pc_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(current_pc_list['pc_number'])} 番", custom_id=f"pcregister_{str(current_pc_list['pc_number'])}") + if current_pc_list['pc_token'] == None: + pass else: - pc_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(current_pc_list['pc_number'])} 番 | ({current_pc_list['alt_name']})", custom_id=f"pcregister_{str(current_pc_list['pc_number'])}") + if current_pc_list['alt_name'] == None: + pc_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(current_pc_list['pc_number'])} 番", custom_id=f"pcregister_{str(current_pc_list['pc_number'])}") + else: + pc_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(current_pc_list['pc_number'])} 番 | ({current_pc_list['alt_name']})", custom_id=f"pcregister_{str(current_pc_list['pc_number'])}") + pc_button_view.add_item(pc_register_button) await client.get_channel(text_channel.id).send(f'# :index_pointing_at_the_viewer: 使いたいPCの番号を選んでください!', view=pc_button_view)