Skip to content

Commit 67c0cc8

Browse files
committed
1 parent 514bd51 commit 67c0cc8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cogs/modmail.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,14 +693,20 @@ async def sfw(self, ctx):
693693
sent_emoji, _ = await self.bot.retrieve_emoji()
694694
await self.bot.add_reaction(ctx.message, sent_emoji)
695695

696-
@commands.command()
696+
@commands.command(name="msglink", aliases=["messagelink"])
697697
@checks.has_permissions(PermissionLevel.SUPPORTER)
698698
@checks.thread_only()
699699
async def msglink(self, ctx, message_id: int):
700700
"""Retrieves the link to a message in the current thread."""
701-
try:
702-
message = await ctx.thread.recipient.fetch_message(message_id)
703-
except discord.NotFound:
701+
found = False
702+
for recipient in ctx.thread.recipients:
703+
try:
704+
message = await recipient.fetch_message(message_id)
705+
found = True
706+
break
707+
except discord.NotFound:
708+
continue
709+
if not found:
704710
embed = discord.Embed(
705711
color=self.bot.error_color, description="Message not found or no longer exists."
706712
)

0 commit comments

Comments
 (0)