'Discord.Js Message Link

So I've looked through the discord.js docs. I'm not too good at reading docs but is there a way to get the url of the message that initiated the command like:

console.log(`${message.content.URL}`)


Solution 1:[1]

To get the URL of a message, you can just use .url. The code would look something like:

client.on('messageCreate', (message) => {
    const url = message.url
})

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Caladan