windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
265 stars 118 forks source link

[Feature Request] Poll with multiple answers #181

Closed Dodoooh closed 3 years ago

Dodoooh commented 3 years ago

Did you see this?

yes, but here it is only possible to create a poll which has only one answer option for the end user. I would like to have the possibility that the Telegram user can select multiple answers.

Originally posted by @Dodoooh in https://github.com/windkh/node-red-contrib-telegrambot/issues/180#issuecomment-841718887


because I think I was misunderstood I open this issue again.

I would like to have multiple answer options also as a telegram user not only have one option which is selectable.

Or is this possible, would not be clear to me how. thank you very much.

windkh commented 3 years ago

Well, you can use all options of sendPoll as described in the API.

Dodoooh commented 3 years ago

ah really then I apologize for that.

but how do i implement these options? or where can i read about this. is not clear to me right now.

anyway thanks a lot

windkh commented 3 years ago

sendPoll(chatId, msg.payload.content, msg.payload.options)

windkh commented 3 years ago

I can try adding an additional parameter for passing all of those optional arguments... maybe you can support me in testing this

Dodoooh commented 3 years ago

I can try adding an additional parameter for passing all of those optional arguments... maybe you can support me in testing this

unfortunately I don't have my NodeRed instance. (on the road) so I could not test it right now. But yes I like to help where I can 👍 Let me know

Dodoooh commented 3 years ago

sendPoll(chatId, msg.payload.content, msg.payload.options)

well i have now tried to integrate it more or less all ways. unfortunately it does not want to work. i think i still understand something wrong

Would it be possible to see a more detailed example?

msg.payload =
{
    chatId : -12345678,
    type : "poll",
    allows_multiple_answers: true,
    is_anonymous: false,
    content :
    {
        question: ["Montag", "Dienstag"]
    },
    options :
    {
        disable_notification : true
    }
}

return msg;
windkh commented 3 years ago

version 9.4.3 should fix this. See https://github.com/windkh/node-red-contrib-telegrambot/blob/master/examples/createpoll.json