Hey, so I’m trying to code a Discord bot so that when the command is sent, the embed is sent with a random picture. Here’s what I did:
const images = [“Image1Url”, “Image2Url”, “Image3Url”];
const image = images[Math.floor(Math.random() * images.length)];
if (command ===
const random = new Discord.MessageEmbed() .setTitle('Test') .setImage(image) message.channel.send(random);
There are no errors apparently, but when I try to run it in cmd, I get this:
ReferenceError: command is not defined
So yeah, I guess I didn’t define it. How do I fix this? Thanks. Also, I’m an absolute beginner at coding, so keep that in mind.