TypeError: Cannot read property 'get' of undefined :/

Hey, I made a snipe command but
the bot cannot read property ‘get’ of undefined :confused:
My code:

const Discord = require(“discord.js”)
const db = require(“quick.db”)

module.exports = {
name: “snipe”,
description: “Affiche le dernier message supprimé du channel.”,
usage: “snipe”,
run:(bot, message, args) => {

const msg = bot.snipes.get(message.channel.id)
if (!msg) return message.channel.send("❌ Il n'y a pas d'ancien message supprimé !")

let SnipeEmbed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL())
    .addField(msg.content)
    .setColor("RANDOM")
message.channel.send(SnipeEmbed)

}
}

The message object is already in the message variable just replace “const msg = bot.snipes.get(message.channel.id)” with “const msg = message;”, or better replace if(!msg) with if(!message)

const Discord = require(“discord.js”)
const db = require(“quick.db”)

module.exports = {
name: “snipe”,
description: “Affiche le dernier message supprimé du channel.”,
usage: “snipe”,
run:(bot, message, args) => {

const msg = message;
if (!msg) return message.channel.send("❌ Il n'y a pas d'ancien message supprimé !")

let SnipeEmbed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL())
    .addField(msg.content)
    .setColor("RANDOM")
message.channel.send(SnipeEmbed)

}
}

Error:
(node:1870) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘tag’ of undefined

11:56 AM

Jump Toat Object.run (/app/Commands/Moderation/snipe.js:14:35)

11:56 AM

Jump Toat module.exports (/app/Events/Messages/message.js:46:11)

11:56 AM

at processTicksAndRejections (internal/process/task_queues.js:93:5)

11:56 AM

(Use node --trace-warnings ... to show where the warning was created)

11:56 AM

(node:1870) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line options | Node.js v15.10.0 Documentation). (rejection id: 1)

11:56 AM

(node:1870) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.