You mean, you want to respond anything?
You could call Math.random()
function, get any number, stringify and just message.reply(x)
where x
is your random number.
Also you could use random-text-generator
module from npm and for example reply with american city or something like: New York, Los Angeles etc. You only need to install this module.
Remember to call random function every time like this:
module.exports = {
name: 'random',
description: "random responses",
execute(message, args) {
message.reply(Math.random().toString());
}
}
If you want random response from array like:
cities=["New York","Los Angeles","Chicago","Houston","Phoenix","Philadelphia","San Antonio"]
You could do this:
module.exports = {
name: 'random',
description: "random responses",
execute(message, args) {
let cities=["New York","Los Angeles","Chicago","Houston","Phoenix","Philadelphia","San Antonio"]
let randomNbr = Math.floor(Math.random() * 6);
message.reply(cities[randomNbr]);
}
}