From 970263eb9fd2301ee4294cfdea3531c62c8e62d5 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:44:53 -0700 Subject: [PATCH 1/6] Some hotfix changes from prod --- changelog.md | 9 +++++++++ modules/moderation/moderator.py | 2 +- modules/moderation/nickname.py | 4 +++- modules/moderation/notes.py | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index d5c5df9e..192fded1 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,15 @@ Changes since 2026.06.15 ### Factoid - Make /factoid call work with factoids with spaces +### Moderator +- Fix /mute command using the wrong datetime object + +### Nickname +- Fix config call missing guild ID + +### Notes +- Fix clear note/note being wrong + ## Utility # Dependencies diff --git a/modules/moderation/moderator.py b/modules/moderation/moderator.py index 92c588c6..e1a1f16d 100644 --- a/modules/moderation/moderator.py +++ b/modules/moderation/moderator.py @@ -319,7 +319,7 @@ async def handle_mute_user( await interaction.response.send_message(embed=embed) return - expires_at = datetime.datetime.now(datetime.UTC) + delta_duration + expires_at = datetime.now(datetime.UTC) + delta_duration result = await moderation.mute_user( user=target, reason=f"{reason} - muted by {interaction.user}", diff --git a/modules/moderation/nickname.py b/modules/moderation/nickname.py index eff212d9..e8a74a5b 100644 --- a/modules/moderation/nickname.py +++ b/modules/moderation/nickname.py @@ -94,7 +94,9 @@ async def match(self: Self, ctx: commands.Context, content: str) -> bool: Returns: bool: If the nickname needs to be changed or not """ - if not configuration.get_config_entry("nickname_enable_on_message"): + if not configuration.get_config_entry( + ctx.guild.id, "nickname_enable_on_message" + ): return False modified_name = format_username(ctx.author.display_name) diff --git a/modules/moderation/notes.py b/modules/moderation/notes.py index 21770e1f..ea3dfde6 100644 --- a/modules/moderation/notes.py +++ b/modules/moderation/notes.py @@ -156,7 +156,7 @@ async def set_note( await modlog.log_action( bot=self.bot, - action_type="clear note", + action_type="note", guild=interaction.guild, member=user, moderator=interaction.user, @@ -234,7 +234,7 @@ async def clear_notes( await modlog.log_action( bot=self.bot, - action_type="note", + action_type="clear note", guild=interaction.guild, member=user, moderator=interaction.user, From bd1e26f567420eec4b19807ac05641e67fbea266 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:50:12 -0700 Subject: [PATCH 2/6] More hotfixes --- modules/moderation/moderator.py | 4 ++-- modules/moderation/modlog.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/moderation/moderator.py b/modules/moderation/moderator.py index e1a1f16d..3dca1cf1 100644 --- a/modules/moderation/moderator.py +++ b/modules/moderation/moderator.py @@ -2,7 +2,7 @@ from __future__ import annotations -from datetime import datetime, timedelta +from datetime import UTC, datetime, timedelta from typing import TYPE_CHECKING, Self import dateparser @@ -319,7 +319,7 @@ async def handle_mute_user( await interaction.response.send_message(embed=embed) return - expires_at = datetime.now(datetime.UTC) + delta_duration + expires_at = datetime.now(UTC) + delta_duration result = await moderation.mute_user( user=target, reason=f"{reason} - muted by {interaction.user}", diff --git a/modules/moderation/modlog.py b/modules/moderation/modlog.py index 21915ec9..4c8bfef3 100644 --- a/modules/moderation/modlog.py +++ b/modules/moderation/modlog.py @@ -289,8 +289,6 @@ async def on_audit_log_entry_create( # This is NOT for native automod actions. Because why be even slightly consistent moderator = await self.bot.fetch_user(entry.user_id) - print(moderator) - if not moderator or moderator.bot: return From 6f3c2bcf471284b75dfdb8b0520787cc4c53a778 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 15 Jun 2026 13:10:26 -0700 Subject: [PATCH 3/6] Fix permissions factoid add --- changelog.md | 2 +- modules/operation/factoids.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 192fded1..61581380 100644 --- a/changelog.md +++ b/changelog.md @@ -24,7 +24,7 @@ Changes since 2026.06.15 - Fix config call missing guild ID ### Notes -- Fix clear note/note being wrong +- Fix clear note/note being wrong in modlog entries ## Utility diff --git a/modules/operation/factoids.py b/modules/operation/factoids.py index 60c2cbb3..542e4b99 100644 --- a/modules/operation/factoids.py +++ b/modules/operation/factoids.py @@ -71,6 +71,21 @@ async def has_manage_factoids_role(ctx: commands.Context) -> bool: ) +async def has_manage_factoids_role_interaction(interaction: discord.Interaction) -> bool: + """A command check to determine if the invoker is allowed to modify basic factoids + + Args: + ctx (commands.Context): The context the command was run + + Returns: + bool: True if the command can be run, False if it can't + """ + return await has_given_factoids_role( + interaction.guild, + interaction.user, + configuration.get_config_entry(interaction.guild.id, "factoids_manage_roles"), + ) + async def has_admin_factoids_role(ctx: commands.Context) -> bool: """A command check to determine if the invoker is allowed to modify factoid properties @@ -1113,6 +1128,7 @@ async def factoid_call_command( sent_message, interaction.user, interaction.channel, factoid.message ) + @app_commands.check(has_manage_factoids_role_interaction) @factoid_app_group.command( name="add", description="Creates a new factoid.", From 4a7627f2548eb1f0e3efd222ac6779269d45cdcc Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 15 Jun 2026 13:15:09 -0700 Subject: [PATCH 4/6] Docstring fixes --- changelog.md | 1 + modules/operation/factoids.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 61581380..f8acb6ee 100644 --- a/changelog.md +++ b/changelog.md @@ -16,6 +16,7 @@ Changes since 2026.06.15 ### Factoid - Make /factoid call work with factoids with spaces +- Fix permissions on /factoid add ### Moderator - Fix /mute command using the wrong datetime object diff --git a/modules/operation/factoids.py b/modules/operation/factoids.py index 542e4b99..0da83d8b 100644 --- a/modules/operation/factoids.py +++ b/modules/operation/factoids.py @@ -75,7 +75,7 @@ async def has_manage_factoids_role_interaction(interaction: discord.Interaction) """A command check to determine if the invoker is allowed to modify basic factoids Args: - ctx (commands.Context): The context the command was run + interaction (discord.Interaction): The context the command was run Returns: bool: True if the command can be run, False if it can't From 412df1b0a54a6d03b022b4f82f83917d71b58061 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 15 Jun 2026 13:24:11 -0700 Subject: [PATCH 5/6] Fix changelog --- changelog.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index f8acb6ee..a6488764 100644 --- a/changelog.md +++ b/changelog.md @@ -12,12 +12,6 @@ Changes since 2026.06.15 ## Moderation -## Operation - -### Factoid -- Make /factoid call work with factoids with spaces -- Fix permissions on /factoid add - ### Moderator - Fix /mute command using the wrong datetime object @@ -27,6 +21,12 @@ Changes since 2026.06.15 ### Notes - Fix clear note/note being wrong in modlog entries +## Operation + +### Factoid +- Make /factoid call work with factoids with spaces +- Fix permissions on /factoid add + ## Utility # Dependencies From aaf9020fff296c4dc302bebeb259d515461b4967 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 15 Jun 2026 13:43:21 -0700 Subject: [PATCH 6/6] Formatting changes --- modules/operation/factoids.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/operation/factoids.py b/modules/operation/factoids.py index 0da83d8b..587a7895 100644 --- a/modules/operation/factoids.py +++ b/modules/operation/factoids.py @@ -71,7 +71,9 @@ async def has_manage_factoids_role(ctx: commands.Context) -> bool: ) -async def has_manage_factoids_role_interaction(interaction: discord.Interaction) -> bool: +async def has_manage_factoids_role_interaction( + interaction: discord.Interaction, +) -> bool: """A command check to determine if the invoker is allowed to modify basic factoids Args: @@ -86,6 +88,7 @@ async def has_manage_factoids_role_interaction(interaction: discord.Interaction) configuration.get_config_entry(interaction.guild.id, "factoids_manage_roles"), ) + async def has_admin_factoids_role(ctx: commands.Context) -> bool: """A command check to determine if the invoker is allowed to modify factoid properties