Skip to content

Commit

Permalink
Merge branch 'jumplink' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Mar 7, 2021
2 parents c5a48f0 + e0956c4 commit 89e1555
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 89e1555

Please sign in to comment.