From 65d1f6e5686e8d8627b61d8e9e9b1a6250b80195 Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Thu, 26 Sep 2024 16:57:49 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=90=86=E7=94=B1=E3=81=AE?= =?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=80=E3=83=AB=E3=81=8C=E8=B5=B7=E5=8B=95?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker_slash.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dislocker_slash.py b/dislocker_slash.py index e75931e..89a6a32 100644 --- a/dislocker_slash.py +++ b/dislocker_slash.py @@ -705,7 +705,7 @@ class DL(): class ReasonModal(discord.ui.Modal): def __init__(self, title: str, pc_number: str, keyboard_number: str, mouse_number: str, timeout=15) -> None: super().__init__(title=title, timeout=timeout) - self.reason_input_form = discord.ui.TextInput(label="使用目的を入力してください", style=discord.ui.TextInput.short, custom_id=f"register_{pc_number}_{keyboard_number}_{mouse_number}") + self.reason_input_form = discord.ui.TextInput(label="使用目的を入力してください", style=discord.TextStyle.short, custom_id=f"register_{pc_number}_{keyboard_number}_{mouse_number}") self.add_item(self.reason_input_form) async def on_submit(self, interaction: discord.Interaction) -> None: @@ -795,8 +795,11 @@ async def on_button(interaction: discord.Interaction): keyboard_register_view = discord.ui.View(timeout=15) pc_number = custom_id_split[1] for i in dislocker.keyboard_list: - keyboard_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(i)}", custom_id=f"keyboardregister_{str(pc_number)}_{str(i)}") - keyboard_register_view.add_item(keyboard_register_button) + if i == 0: + pass + else: + keyboard_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(i)}", custom_id=f"keyboardregister_{str(pc_number)}_{str(i)}") + keyboard_register_view.add_item(keyboard_register_button) keyboard_not_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label="キーボードは自前", custom_id=f"keyboardregister_{str(pc_number)}_own") keyboard_register_view.add_item(keyboard_not_register_button) @@ -811,8 +814,11 @@ async def on_button(interaction: discord.Interaction): else: keyboard_number_show = keyboard_number for i in dislocker.mouse_list: - mouse_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(i)}", custom_id=f"mouseregister_{str(pc_number)}_{str(keyboard_number)}_{str(i)}") - mouse_register_view.add_item(mouse_register_button) + if i == 0: + pass + else: + mouse_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label=f"{str(i)}", custom_id=f"mouseregister_{str(pc_number)}_{str(keyboard_number)}_{str(i)}") + mouse_register_view.add_item(mouse_register_button) mouse_not_register_button = discord.ui.Button(style=discord.ButtonStyle.primary, label="マウスは自前", custom_id=f"mouseregister_{str(pc_number)}_{str(keyboard_number)}_own") mouse_register_view.add_item(mouse_not_register_button)