Preferably through a const such as const responses = ["response1", "response2", response3"] using
discord.js v12.2.0.
Advertisement
Answer
JavaScript
x
6
1
// Creating an array with responses.
2
const Responses = ["Response1", "Response2", "Response3", "Response4"];
3
4
// Picking a random response and logging it.
5
console.log(Responses[Math.floor(Math.random() * Responses.length)]);
6