diff --git a/cogs/modmail.py b/cogs/modmail.py index ee109420af..f0ee2815c8 100644 --- a/cogs/modmail.py +++ b/cogs/modmail.py @@ -601,6 +601,23 @@ async def sfw(self, ctx): sent_emoji, _ = await self.bot.retrieve_emoji() await self.bot.add_reaction(ctx.message, sent_emoji) + @commands.command() + @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: + embed = discord.Embed( + color=self.bot.error_color, description="Message not found or no longer exists." + ) + else: + embed = discord.Embed( + color=self.bot.main_color, description=message.jump_url + ) + await ctx.send(embed=embed) + @commands.command() @checks.has_permissions(PermissionLevel.SUPPORTER) @checks.thread_only() diff --git a/core/thread.py b/core/thread.py index d534ef352e..98f67ca897 100644 --- a/core/thread.py +++ b/core/thread.py @@ -300,7 +300,11 @@ def _format_info_embed(self, user, log_url, log_count, color): # embed.add_field(name='Mention', value=user.mention) # embed.add_field(name='Registered', value=created + days(created)) - footer = "User ID: " + str(user.id) + if user.dm_channel: + footer = f"User ID: {user.id} • DM ID: {user.dm_channel}" + else: + footer = f"User ID: {user.id}" + embed.set_author(name=str(user), icon_url=user.avatar_url, url=log_url) # embed.set_thumbnail(url=avi)