From 6350f9db4f8d1f5d36c35231d7f589649b921567 Mon Sep 17 00:00:00 2001 From: "Nyeki.py" <84998222+Nekidev@users.noreply.github.com> Date: Sun, 27 Oct 2024 01:49:16 -0300 Subject: [PATCH] fix(bot): :bug: Edits not working when the new content has mentions. --- payphone/cogs/calls/cog.py | 2 +- payphone/core/formatting.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/payphone/cogs/calls/cog.py b/payphone/cogs/calls/cog.py index e95e176..0c98bce 100644 --- a/payphone/cogs/calls/cog.py +++ b/payphone/cogs/calls/cog.py @@ -1010,7 +1010,7 @@ class Calls(base.Cog): call_rss = await models.CallUserChannelRelationship.filter( call_id=channel.call_id - ) + ).select_related("profile") cleaned_content = formatting.clean(original_message, call_rss) diff --git a/payphone/core/formatting.py b/payphone/core/formatting.py index e7a893f..4d7a717 100644 --- a/payphone/core/formatting.py +++ b/payphone/core/formatting.py @@ -159,7 +159,8 @@ def clean( Args: message (discord.Message): The message to clean. - call_rss (list[models.CallUserChannelRelationship]): The call's relationships. + call_rss (list[models.CallUserChannelRelationship]): The call's relationships. They must + have pre-selected their `profile` relation. Returns: str: The cleaned message content.