From d93a1db51f43be0fd96172ac7411c000eb338b47 Mon Sep 17 00:00:00 2001 From: Rene Teigen Date: Wed, 11 Jan 2023 10:15:37 +0000 Subject: [PATCH] Shorten the replace function --- cogs/gpt_3_commands_and_converser.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index 9ce8748..6cc4c77 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -745,8 +745,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): if discord.utils.raw_mentions(message): for mention in discord.utils.raw_mentions(message): user = await discord.utils.get_or_fetch(ctx.guild, 'member', mention, default="User") - display_name = user.display_name - message = message.replace(f"<@{str(mention)}>", display_name) + message = message.replace(f"<@{str(mention)}>", user.display_name) return message else: return message