I have a simple code here. Im using https://github.com/yagop/node-telegram-bot-api telegram framework to make my first bot. I have array with 10 questions in it. So i can't understarnd what should i do if i want to start a new poll only after user answered for a previous one? My current code just list all 10 polls when i use /start. Here is my code (i used snippet cos its working correct only in this way):
bot.onText(/\/start (.+)/, (msg, [source, match]) => {
const { id } = msg.chat
if (match === test1Code){
for (let i=0; i<test1Questions.length; i++){
bot.sendPoll(id, test1Questions[i], pollOptions, {
is_anonymous: false
})
}
}
})