Closed mohammadameer closed 5 years ago
i have a list of responses to request
let res = [ "how are you", "wow", ]
for every request there will be a response i have make a prototype in the array object to get random from the array
Array.prototype.random = function () { return this[Math.floor(Math.random() * this.length)] } bot.hear(words.hello.req, (payload, chat) => { let res = words.hello.res.random chat.say(res) })
i upload my code to heroku and i get this
` Invalid format for .say() message.
`
the problem was that i have not make the random function work i just need to add ()
()
i have a list of responses to request
let res = [ "how are you", "wow", ]
for every request there will be a response i have make a prototype in the array object to get random from the array
i upload my code to heroku and i get this
` Invalid format for .say() message.
`