From ba32eec7e8903d6cd6d589c9fa3feda506a33537 Mon Sep 17 00:00:00 2001 From: Isabella Date: Wed, 25 Jul 2018 22:38:11 -0400 Subject: [PATCH] feat(Message): add url getter (#2594) * feat(Message): add jumpToURL getter * fix url * url syntax update * name to url --- src/structures/Message.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/structures/Message.js b/src/structures/Message.js index aea85a604..1b5d677d9 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -237,6 +237,15 @@ class Message extends Base { return this.channel.guild || null; } + /** + * The url to jump to this message + * @type {string} + * @readonly + */ + get url() { + return `https://discordapp.com/channels/${this.guild ? this.guild.id : '@me'}/${this.channel.id}/${this.id}`; + } + /** * The message contents with all mentions replaced by the equivalent text. * If mentions cannot be resolved to a name, the relevant mention in the message content will not be converted.