mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
feat(Message): add url getter (#2594)
* feat(Message): add jumpToURL getter * fix url * url syntax update * name to url
This commit is contained in:
parent
5afd77ab73
commit
ba32eec7e8
1 changed files with 9 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue