Add jump_url property to channels

This commit is contained in:
Omkaar
2022-04-12 09:53:15 +05:30
committed by GitHub
parent 6265723a35
commit 348764583d
2 changed files with 24 additions and 0 deletions

View File

@ -501,6 +501,14 @@ class GuildChannel:
""":class:`str`: The string that allows you to mention the channel."""
return f'<#{self.id}>'
@property
def jump_url(self) -> str:
""":class:`str`: Returns a URL that allows the client to jump to the channel.
.. versionadded:: 2.0
"""
return f'https://discord.com/channels/{self.guild.id}/{self.id}'
@property
def created_at(self) -> datetime:
""":class:`datetime.datetime`: Returns the channel's creation time in UTC."""