yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.4k stars 1.52k forks source link

Request support for Polls: New Telegram Bot API v4.2 #718

Closed danielperez9430 closed 4 years ago

danielperez9430 commented 5 years ago

Request for support for Polls

Changelog: Bot API 4.2 April 14, 2019

Source: https://core.telegram.org/bots/api#april-14-2019

kamikazechaser commented 5 years ago

Todo

alexandercerutti commented 5 years ago

I think this update should include all the updates reported in Telegram bot blog: https://core.telegram.org/bots/api-changelog#april-14-2019

danielperez9430 commented 5 years ago

@alexandercerutti The only thing missing function is the pools. The rest of the improvements are server-side and they work perfectly with the current library

Example:

msg.forward_sender_name // Return name of the user if user have forward restrictions active

alexandercerutti commented 5 years ago

@danielperez9430 oh okay, so nvm. 😊

kamikazechaser commented 5 years ago

The main features are ready. Just need to add the tests. Alternatively, if there is high demand for the features before the tests are written, I will merge the changes.

danielperez9430 commented 5 years ago

@kamikazechaser WoW, good work mate. It's possible to use it, now?

Update: I tried to download the changes and paste them into the Node_Modules folder and works

Polm90 commented 4 years ago

Does the code in the master branch already work for Polls 2.0? https://telegram.org/blog/polls-2-0-vmq

Thank you

kamikazechaser commented 4 years ago

Yes, it should work, just pass type as an optional parameter.

rudyxxx commented 4 years ago

Hi, please can me send the correct sintaxt to use in a node js telegram bot? I don' find how to use... I need to create quiz and polls.

danielperez9430 commented 4 years ago

Hi, please can me send the correct sintaxt to use in a node js telegram bot? I don' find how to use... I need to create quiz and polls.

Check this examples mate: https://tecnonucleous.com/2020/02/13/como-enviar-encuestas-2-0-con-nuetro-bot-de-telegram/

rudyxxx commented 4 years ago

Hi, please can me send the correct sintaxt to use in a node js telegram bot? I don' find how to use... I need to create quiz and polls.

Check this examples mate: https://tecnonucleous.com/2020/02/13/como-enviar-encuestas-2-0-con-nuetro-bot-de-telegram/

bot.onText(/^!encuesta|^\/encuesta/,

There is a way to use a variable in object of poll? Same as "encuesta + variabletext"?

danielperez9430 commented 4 years ago

Hi, please can me send the correct sintaxt to use in a node js telegram bot? I don' find how to use... I need to create quiz and polls.

Check this examples mate: https://tecnonucleous.com/2020/02/13/como-enviar-encuestas-2-0-con-nuetro-bot-de-telegram/

bot.onText(/^!encuesta|^/encuesta/,

There is a way to use a variable in object of poll? Same as "encuesta + variabletext"?

You can match text before the command, like this example:

// Matches "/echo [whatever]"
bot.onText(/\/echo (.+)/, (msg, match) => {
  // 'msg' is the received Message from Telegram
  // 'match' is the result of executing the regexp above on the text content
  // of the message

  const chatId = msg.chat.id;
  const resp = match[1]; // the captured "whatever"
// More...

});
qadirsuh commented 4 years ago

Wow! so can we create the polls now? via this npm module? Please guide me to the documentation link and/or code samples. thank you