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
2 changes: 1 addition & 1 deletion modules/administration/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def echo_channel(

await auxiliary.send_confirm_embed(message="Message sent", channel=ctx.channel)
# Don't allow logging if extension is disabled
if "logger" not in configuration.get_config_entry(
if "moderation.logger" not in configuration.get_config_entry(
channel.guild.id, "core_enabled_extensions"
):
return
Expand Down
4 changes: 2 additions & 2 deletions modules/moderation/modlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ async def log_ban(
guild (discord.Guild): The guild the member was banned from
reason (str): The reason for the ban
"""
if "modlog" not in configuration.get_config_entry(
if "moderation.modlog" not in configuration.get_config_entry(
guild.id, "core_enabled_extensions"
):
return
Expand Down Expand Up @@ -330,7 +330,7 @@ async def log_unban(
guild (discord.Guild): The guild the member was unbanned from
reason (str): The reason for the unban
"""
if "modlog" not in configuration.get_config_entry(
if "moderation.modlog" not in configuration.get_config_entry(
guild.id, "core_enabled_extensions"
):
return
Expand Down
11 changes: 7 additions & 4 deletions modules/moderation/whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ async def whois_command(
interaction.guild.id, "core_enabled_extensions"
)

if "application" in enabled_extensions:
if "operation.application" in enabled_extensions:
try:
await application.command_permission_check(interaction)
embed = await add_application_info_field(interaction, member, embed)
except (app_commands.MissingAnyRole, app_commands.AppCommandError):
pass

if "xp" in enabled_extensions:
if "operation.xp" in enabled_extensions:
current_XP = await xp.get_current_XP(self.bot, member, interaction.guild)
embed.add_field(name="XP", value=current_XP)

Expand Down Expand Up @@ -115,7 +115,7 @@ async def whois_command(

embeds = [embed]

if "notes" in enabled_extensions:
if "moderation.notes" in enabled_extensions:
try:
await notes.is_reader(interaction)
all_notes = await moderation.get_all_notes(
Expand All @@ -131,7 +131,10 @@ async def whois_command(
except (app_commands.MissingAnyRole, app_commands.AppCommandError):
pass

if "moderator" in enabled_extensions and interaction.permissions.kick_members:
if (
"moderation.moderator" in enabled_extensions
and interaction.permissions.kick_members
):
all_warnings = await moderation.get_all_warnings(
self.bot, member, interaction.guild
)
Expand Down
2 changes: 1 addition & 1 deletion modules/operation/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ async def check_if_can_apply(self: Self, applicant: discord.Member) -> bool:
)
)
# Don't allow applications if extension is disabled
if "application" not in configuration.get_config_entry(
if "operation.application" not in configuration.get_config_entry(
applicant.guild.id, "core_enabled_extensions"
):
return False
Expand Down
2 changes: 1 addition & 1 deletion modules/operation/factoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ async def send_to_logger(
factoid_message (str): The plaintext message content of the factoid
"""
# Don't allow logging if extension is disabled
if "logger" not in configuration.get_config_entry(
if "moderation.logger" not in configuration.get_config_entry(
factoid_caller.guild.id, "core_enabled_extensions"
):
return
Expand Down
2 changes: 1 addition & 1 deletion modules/operation/paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def response(
if len(content) > length_limit or content.count("\n") > self.max_newlines(
length_limit
):
if "automod" in configuration.get_config_entry(
if "moderation.automod" in configuration.get_config_entry(
ctx.guild.id, "core_enabled_extensions"
):
automod_actions = await automod.run_all_checks(ctx.message)
Expand Down
4 changes: 2 additions & 2 deletions modules/operation/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ async def send_message_from_irc(self: Self, split_message: dict[str, str]) -> No
message=split_message["content"], channel=discord_channel
)

if "automod" in configuration.get_config_entry(
if "moderation.automod" in configuration.get_config_entry(
discord_channel.guild.id, "core_enabled_extensions"
) and str(discord_channel.id) in configuration.get_config_entry(
discord_channel.guild.id, "automod_channels"
Expand Down Expand Up @@ -454,7 +454,7 @@ async def send_message_from_irc(self: Self, split_message: dict[str, str]) -> No
sent_message = await discord_channel.send(content=mentions_string, embed=embed)

# Don't allow logging if extension is disabled
if "logger" not in configuration.get_config_entry(
if "moderation.logger" not in configuration.get_config_entry(
discord_channel.guild.id, "core_enabled_extensions"
):
return
Expand Down
2 changes: 1 addition & 1 deletion modules/operation/xp.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def match(self: Self, ctx: commands.Context, _: str) -> bool:
return False

# Ignore messages that are factoid calls
if "factoids" in configuration.get_config_entry(
if "operation.factoids" in configuration.get_config_entry(
ctx.guild.id, "core_enabled_extensions"
):
factoid_prefix = configuration.get_config_entry(
Expand Down
Loading