var testmessages = ["message one", "message two", "message three", "message four"]
var testrandomform = testmessages[Math.floor(Math.random()*testmessages.length)];
module.exports = {
name: 'random',
description: "",
execute(message, args){
message.channel.send(testrandomform).then().catch(console.error);
}
}
So, the problem with this is so far although it does load and send messages. It only picks the first word of testmessages and never picks the other ones. If possible I would like some help on this, I’m sorta new to this and would like some minor help if anyone can offer it?
The code is stored in the command name file called random.js which is loaded from main.js
I have tried and did find some posts related to this but those ended with zero finds as well.
The reason for the needing of random messages is because I would like a randomized message each time the user activates the command. For an example, if the user activates the command !help I will make it where it sends an embed to the user via message.author but here is the other thing. I would like it to also send a message to the channel via message.channel but I want this to be randomized.