Skip to content

Commit 4ef3ef5

Browse files
committed
Disabled buttons after submitting words using ~bladd or ~blrem
1 parent c90c552 commit 4ef3ef5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

utils/views/blacklist_add_view.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Optional
55
from utils import BlacklistAddDropdown, BlacklistAddModal
66

7-
FILEPATH = 'files/blacklist.json'
7+
FILEPATH = "files/blacklist.json"
88

99

1010
class BlacklistAddView(discord.ui.View):
@@ -78,10 +78,11 @@ async def submit(self, interaction: discord.Interaction, button: discord.Button)
7878
if len(values) > len(words):
7979
embed.set_footer(text="⚠️ Some words were duplicates and were not added.")
8080
await interaction.followup.send(embed=embed)
81+
await self.disable_all_buttons()
8182

8283
@discord.ui.button(label="Abort", style=discord.ButtonStyle.red, emoji="👎🏻")
8384
async def abort(self, interaction: discord.Interaction, button: discord.Button):
8485
await interaction.response.send_message(
8586
f"❌ {interaction.user.mention}: Aborting command!", ephemeral=True
8687
)
87-
await self.disable_all_buttons(interaction)
88+
await self.disable_all_buttons(interaction)

utils/views/blacklist_remove_view.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Optional
55
from utils import BlacklistRemoveDropdown, BlacklistRemoveModal
66

7-
FILEPATH = 'files/blacklist.json'
7+
FILEPATH = "files/blacklist.json"
88

99

1010
class BlacklistRemoveView(discord.ui.View):
@@ -69,7 +69,7 @@ async def submit(self, interaction: discord.Interaction, button: discord.Button)
6969
if id not in blacklist.keys():
7070
return await interaction.followup.send(
7171
f"❌ {interaction.user.mention}: This server does not have any words blacklisted.",
72-
ephemeral=True
72+
ephemeral=True,
7373
)
7474

7575
print(values)
@@ -96,10 +96,11 @@ async def submit(self, interaction: discord.Interaction, button: discord.Button)
9696
embed.set_footer(text="⚠️ Some words were duplicates and were not added.")
9797

9898
await interaction.followup.send(embed=embed)
99+
await self.disable_all_buttons()
99100

100101
@discord.ui.button(label="Abort", style=discord.ButtonStyle.red, emoji="👎🏻")
101102
async def abort(self, interaction: discord.Interaction, button: discord.Button):
102103
await interaction.response.send_message(
103104
f"❌ {interaction.user.mention}: Aborting command!", ephemeral=True
104105
)
105-
await self.disable_all_buttons(interaction)
106+
await self.disable_all_buttons(interaction)

0 commit comments

Comments
 (0)