Skip to content

Commit 89e1555

Browse files
committed
Merge branch 'jumplink' into development
2 parents c5a48f0 + e0956c4 commit 89e1555

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

cogs/modmail.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,23 @@ async def sfw(self, ctx):
601601
sent_emoji, _ = await self.bot.retrieve_emoji()
602602
await self.bot.add_reaction(ctx.message, sent_emoji)
603603

604+
@commands.command()
605+
@checks.has_permissions(PermissionLevel.SUPPORTER)
606+
@checks.thread_only()
607+
async def msglink(self, ctx, message_id: int):
608+
"""Retrieves the link to a message in the current thread."""
609+
try:
610+
message = await ctx.thread.recipient.fetch_message(message_id)
611+
except discord.NotFound:
612+
embed = discord.Embed(
613+
color=self.bot.error_color, description="Message not found or no longer exists."
614+
)
615+
else:
616+
embed = discord.Embed(
617+
color=self.bot.main_color, description=message.jump_url
618+
)
619+
await ctx.send(embed=embed)
620+
604621
@commands.command()
605622
@checks.has_permissions(PermissionLevel.SUPPORTER)
606623
@checks.thread_only()

core/thread.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,11 @@ def _format_info_embed(self, user, log_url, log_count, color):
300300
# embed.add_field(name='Mention', value=user.mention)
301301
# embed.add_field(name='Registered', value=created + days(created))
302302

303-
footer = "User ID: " + str(user.id)
303+
if user.dm_channel:
304+
footer = f"User ID: {user.id} • DM ID: {user.dm_channel}"
305+
else:
306+
footer = f"User ID: {user.id}"
307+
304308
embed.set_author(name=str(user), icon_url=user.avatar_url, url=log_url)
305309
# embed.set_thumbnail(url=avi)
306310

0 commit comments

Comments
 (0)