(Newbie) ReferenceError: message is not defined

const Discord = require(“discord.js”);

if(message.content.startsWith(’+embed’)) {
let message = message.content
let messagearray = message.split(’+’)
let toembed = messagearray[1]

const embed = new Discord.MessageEmbed()
.setTItle(‘Title’)
.setDescription(${toembed})
message.delete().then(message.channel.send(embed))
}

You need to have a message event around your commands.

1 Like