Update InventoryView to modify close button's custom ID for better clarity and organization. Remove redundant close button instantiation and streamline button handling in the UI.
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
This commit is contained in:
parent
dab195c57f
commit
e8dfad8f3d
1 changed files with 1 additions and 4 deletions
|
@ -251,9 +251,6 @@ class InventoryView(View):
|
|||
self.selected_item = None
|
||||
self.message = None # Store message for timeout handling
|
||||
self.setup_inventory_select()
|
||||
close_button = Button(label="Close", style=discord.ButtonStyle.red, custom_id="close", row=4)
|
||||
close_button.callback = self.close
|
||||
self.add_item(close_button)
|
||||
|
||||
async def interaction_check(self, interaction: discord.Interaction) -> bool:
|
||||
if interaction.user != self.ctx.author:
|
||||
|
@ -261,7 +258,7 @@ class InventoryView(View):
|
|||
return False
|
||||
return True
|
||||
|
||||
@button(label="Close", style=discord.ButtonStyle.red, custom_id="close", row=4)
|
||||
@button(label="Close", style=discord.ButtonStyle.red, custom_id="inventory_close", row=4)
|
||||
async def close(self, interaction: discord.Interaction, button: Button):
|
||||
await interaction.response.edit_message(content="Inventory closed.", embed=None, view=None)
|
||||
self.stop()
|
||||
|
|
Loading…
Add table
Reference in a new issue