So i want to create a discord bot in discord.js that sends random message everytime i type in the command. I’ve looked online and i found a recent thread but the bot selects the random message everytime it gets restarted.
I would be very grateful if someone helped me. I’m really new to all of this so i dont have any experience
`const Discord = require(“discord.js”);
const client = new Discord.Client();
client.on(“ready”, () => {
console.log(“I am ready!”);
});
let replies = [“reply 1”, “reply 2”, “reply 3”];
let random = Math.floor(Math.random() * 3);
client.on(“message”, (message) => {
if (message.content.startsWith(“command”)) {
message.channel.send(replies[random])
}
});
client.login(“token”);`