0

So basically, I'm trying to make a certain command for my bot, and I was going to see if any of you could help write something up. I want to make a command where a user types the command and then the bot will randomly choose from a list of prewritten sentences. I'm trying to make a fact command where when you do !fact it responds with a random fact.

Note: This would be for my command handler.

Thanks if any of you can help!

Brett
  • 7
  • 1
  • 4

1 Answers1

1
var facts = ["Your facts", "...", "..."];
var fact = Math.floor(Math.random() * facts.length);
message.channel.send(facts[fact]);

Here's a command that will do this as you described it in your question!

Best regards, Monkeyyy11

Gilles Heinesch
  • 2,889
  • 1
  • 22
  • 43