From 67c0cc82d42c02896cace899ca8a992ba9d204ff Mon Sep 17 00:00:00 2001 From: Raiden Sakura Date: Sun, 21 Apr 2024 10:12:49 +0800 Subject: [PATCH] Pull #3341 --- cogs/modmail.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cogs/modmail.py b/cogs/modmail.py index ce235b36a1..cda00550b8 100644 --- a/cogs/modmail.py +++ b/cogs/modmail.py @@ -693,14 +693,20 @@ async def sfw(self, ctx): sent_emoji, _ = await self.bot.retrieve_emoji() await self.bot.add_reaction(ctx.message, sent_emoji) - @commands.command() + @commands.command(name="msglink", aliases=["messagelink"]) @checks.has_permissions(PermissionLevel.SUPPORTER) @checks.thread_only() async def msglink(self, ctx, message_id: int): """Retrieves the link to a message in the current thread.""" - try: - message = await ctx.thread.recipient.fetch_message(message_id) - except discord.NotFound: + found = False + for recipient in ctx.thread.recipients: + try: + message = await recipient.fetch_message(message_id) + found = True + break + except discord.NotFound: + continue + if not found: embed = discord.Embed( color=self.bot.error_color, description="Message not found or no longer exists." )