Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,12 @@ async def interaction_check(self: Self, interaction: discord.Interaction) -> boo
# Check 1 - Ensure extension is enabled
# removes "modules."
extension_name = interaction.command.callback.__module__[8:]
# If the extension is disabled, raise an error to show it and block execution
if not self.command_run_extension_disabled_check(
always_enable_command = interaction.command.extras.get("always_enabled", False)
extension_enabled = self.command_run_extension_disabled_check(
interaction.guild, extension_name
):
)
# If the extension is disabled, raise an error to show it and block execution
if not always_enable_command and not extension_enabled:
raise custom_errors.AppCommandExtensionDisabled

# Check 2 - Approve if invoker is bot admin
Expand Down
4 changes: 1 addition & 3 deletions modules/operation/datadelete.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ class DataDeleter(cogs.BaseCog):
@app_commands.command(
name="data_delete",
description="Deletes your data from the databases in the bot",
extras={
"ephemeral_error": True,
},
extras={"ephemeral_error": True, "always_enabled": True},
)
async def dataDeleteCommand(
self: Self,
Expand Down
Loading