diff options
| author | 2021-08-18 15:37:55 +0100 | |
|---|---|---|
| committer | 2021-08-18 15:37:55 +0100 | |
| commit | 0eb07e4ed5090ffbc4c7cf2c2f483d661c796965 (patch) | |
| tree | a652eadf0927854a9adab0b5e95bbcb6d274f614 /arthur/exts/cloudflare/zones.py | |
| parent | Merge branch 'main' of github.com:python-discord/king-arthur (diff) | |
Disable select once complete
Diffstat (limited to 'arthur/exts/cloudflare/zones.py')
| -rw-r--r-- | arthur/exts/cloudflare/zones.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arthur/exts/cloudflare/zones.py b/arthur/exts/cloudflare/zones.py index 0e8212a..c3a2e42 100644 --- a/arthur/exts/cloudflare/zones.py +++ b/arthur/exts/cloudflare/zones.py @@ -19,6 +19,10 @@ class ZonesView(discord.ui.View): for domain, zone_id in self.domains.items(): self.children[0].add_option(label=domain, value=domain, description=zone_id, emoji="🌐") + def disable_select(self): + """Disable the select button.""" + self.children[0].disabled = True + async def interaction_check(self, interaction: discord.Interaction) -> bool: """Ensure the user has the DevOps role.""" return CONFIG.devops_role in [r.id for r in interaction.user.roles] @@ -45,6 +49,10 @@ class ZonesView(discord.ui.View): description_content += f"`{error['code']}`: {error['message']}\n" message = generate_error_message(description=description_content, emote=":x:") + + self.disable_select() + + await interaction.edit_original_message(view=self) await interaction.response.send_message(message) |