Skip to content

Commit 2400ceb

Browse files
authored
msglink command now scans all recipients (#3341)
* msglink command now scans all recipients * Run black formatting
1 parent fa6ad63 commit 2400ceb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cogs/modmail.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,15 @@ async def sfw(self, ctx):
696696
@checks.thread_only()
697697
async def msglink(self, ctx, message_id: int):
698698
"""Retrieves the link to a message in the current thread."""
699-
try:
700-
message = await ctx.thread.recipient.fetch_message(message_id)
701-
except discord.NotFound:
699+
found = False
700+
for recipient in ctx.thread.recipients:
701+
try:
702+
message = await recipient.fetch_message(message_id)
703+
found = True
704+
break
705+
except discord.NotFound:
706+
continue
707+
if not found:
702708
embed = discord.Embed(
703709
color=self.bot.error_color, description="Message not found or no longer exists."
704710
)

0 commit comments

Comments
 (0)