From 41f6eaa6350245b6f139b509b2482201046eec56 Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Thu, 26 Jul 2018 11:22:29 -0600 Subject: [PATCH] backport: Message#url getter --- src/structures/Message.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/structures/Message.js b/src/structures/Message.js index c6179524c..c0f459f15 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -215,6 +215,15 @@ class Message { return this.channel.guild || null; } + /** + * The url to jump to the 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.