aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2018-06-10 15:25:17 -0400
committerRapptz <[email protected]>2018-06-10 15:25:17 -0400
commit7eb918b19e3e60b56eb9039eb267f8f3477c5e17 (patch)
tree708d8734915e5ebbf1cf46e87ba559d80e8f6a72
parentRemove emojis from cache if they're removed from a guild. (diff)
downloaddiscord.py-7eb918b19e3e60b56eb9039eb267f8f3477c5e17.tar.xz
discord.py-7eb918b19e3e60b56eb9039eb267f8f3477c5e17.zip
Add Message.jump_to_url
-rw-r--r--discord/message.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/message.py b/discord/message.py
index 55a1ee3f..e9ebf5f2 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -434,6 +434,12 @@ class Message:
"""Optional[datetime.datetime]: A naive UTC datetime object containing the edited time of the message."""
return self._edited_timestamp
+ @property
+ def jump_to_url(self):
+ """:class:`str`: Returns a URL that allows the client to jump to this message."""
+ guild_id = getattr(self.guild, 'id', '@me')
+ return 'https://discordapp.com/channels/{0}/{1.channel.id}?jump={1.id}'.format(guild_id, self)
+
@utils.cached_slot_property('_cs_system_content')
def system_content(self):
"""A property that returns the content that is rendered